}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (signature != null) {
new SignatureReader(signature).accept(signatureVisitor);
} else {
addMethod(desc);
}
addClasses(exceptions);
return new MethodVisitor(Opcodes.ASM4) {
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
addType(Type.getType(desc));
return null;
}
@Override
public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
addType(Type.getType(desc));
return null;
}
@Override
public void visitTypeInsn(int opcode, String type) {
addType(Type.getObjectType(type));
}
@Override
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
addType(Type.getObjectType(owner));
addType(Type.getType(desc));
}
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
addType(Type.getObjectType(owner));
addMethod(desc);
}
@Override
public void visitLdcInsn(Object cst) {
if (cst instanceof Type) {
addType((Type) cst);
}
}
@Override
public void visitMultiANewArrayInsn(String desc, int dims) {
addType(Type.getType(desc));
}
@Override
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) {
if (signature != null) {
new SignatureReader(signature).acceptType(signatureVisitor);
} else {
addType(Type.getType(desc));
}
}
};