RenameClassAdapter extends ClassAdapter { String renameMethodDesc(String desc) { if (desc == null) { return null; } Type[] args = Type.getArgumentTypes(desc); StringBuilder sb = new StringBuilder("("); for (Type arg : args) { String name = renameType(arg); sb.append(name); } sb.append(')'); Type ret = Type.getReturnType(desc); String name = renameType(ret); sb.append(name); return sb.toString(); } RenameClassAdapter(ClassWriter cv, String oldName, String newName); @Override void visit(int version, int access, String name, String signature,
            String superName, String[] interfaces); @Override void visitInnerClass(String name, String outerName, String innerName, int access); @Override MethodVisitor visitMethod(int access, String name, String desc,
            String signature, String[] exceptions); @Override AnnotationVisitor visitAnnotation(String desc, boolean visible); @Override FieldVisitor visitField(int access, String name, String desc,
            String signature, Object value);  }
@Test public void testRenameMethodDesc() { assertEquals("(IDLorg.blah.New;[Lorg.blah.New$Inner;)Lorg.blah.New$Other;", mOuter.renameMethodDesc("(IDLcom.pack.Old;[Lcom.pack.Old$Inner;)Lcom.pack.Old$Other;")); }