ClassPool classPool = new ClassPool();
classPool.appendClassPath(new LoaderClassPath(original.getClassLoader()));
CtClass ctClass = classPool.getAndRename(swap, original.getName());
reload(original, ctClass.toBytecode());
}
private static void reload(Class original, byte[] bytes) {
Map<Class<?>, byte[]> reloadMap = new HashMap<Class<?>, byte[]>();
reloadMap.put(original, bytes);