ClassReader cr = new ClassReader(bytes);
ClassWriter cw = new ClassWriter(false, true);
cr.accept(
new ClassAdapter(cw) {
public MethodVisitor visitMethod(int access, final String name, String desc, String signature, String[] exceptions) {
return new MethodAdapter(super.visitMethod(access, name, desc, signature, exceptions)) {
public AnnotationVisitor visitAnnotationDefault() {
return new DefaultAnnotationBuilderVisitor(newDefaults, name, loader);
}
};
}