ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
ClassReader cr = new ClassReader(getClass().getResourceAsStream("/"
+ name.replace('.', '/') + ".class"));
cr.accept(new AdviceClassAdapter(cw),
ClassReader.EXPAND_FRAMES);
byte[] bytecode = cw.toByteArray();
return super.defineClass(name, bytecode, 0, bytecode.length);
} catch (IOException ex) {
throw new ClassNotFoundException("Load error: "
+ ex.toString(), ex);
}