@Override public MethodVisitor visitMethod( int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions); /* Remove transplant jobs where the method already exists - probably because of an earlier patch script. */ { Iterator<Hook> it = transplants.iterator(); while (it.hasNext()) { Hook h = it.next(); if (h.getMethodName().equals(name) && h.getMethodDescriptor().equals(desc)) it.remove(); } } for (TargetMatcher t : targets) { if (t.matches(ownClassSpec, name, desc)) { return factory.createMethodVisitor( name, desc, visitor, new MethodLogistics(access, desc)); } } return visitor; }