RenameClassAdapter extends ClassAdapter { String renameType(Type type) { if (type == null) { return null; } if (type.getSort() == Type.OBJECT) { String in = type.getInternalName(); return "L" + renameInternalType(in) + ";"; } else if (type.getSort() == Type.ARRAY) { StringBuilder sb = new StringBuilder(); for (int n = type.getDimensions(); n > 0; n--) { sb.append('['); } sb.append(renameType(type.getElementType())); return sb.toString(); } return type.getDescriptor(); } 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 testRenameType() { }