cg.getJavaClass().accept(new ConstantPoolCleanerVisitor());
    public void visit(String className) throws Exception {        Document document = null;        document = DocumentBuilderFactory.newInstance().newDocumentBuilder()                .newDocument();        Element eClazz = document.createElement("class");        eClazz.setAttribute("name", className);        document.appendChild(eClazz);        if (classes.contains(className)) {            JavaClass jc = repo.findClass(className);            ClassGen cg = new ClassGen(jc);//            if (className.indexOf("$") == -1) {                org.apache.bcel.classfile.Method[] ms = jc.getMethods();                log.debug("Cleaning class: " + className);                for (int i = 0; i < ms.length; i++) {                    Method m = new Method(className, ms[i].getName(), ms[i]                            .getSignature());                    if (!usedMethods.contains(m)) {                        cg.removeMethod(ms[i]);                        if (true) {                            eClazz.appendChild(this.reportMethod(document,                                    ms[i]));                        }                    } else {                        if (Analyser.runtimeClassLoaderMethods.contains(m)) {                            org.apache.bcel.classfile.Method mc= m.toClassFileMethod();                            ConstantPoolGen pool= cg.getConstantPool();                            if (classname == null) {                                classname= m.getClassName();                                cg.addMethod(this.createMethod(m.getClassName(), pool).getMethod());                            }                            cg.replaceMethod(mc ,this.tran(m.toMethodGen(), pool));                            cg.setConstantPool(pool);                        }                    }                }                Field[] fields= jc.getFields();                for (int i = 0; i < fields.length; i++) {                    net.java.dev.jminimizer.beans.Field field= new net.java.dev.jminimizer.beans.Field(className, fields[i].getName(), fields[i].getSignature());                    if(!usedMethods.contains(field)) {                        if (className.indexOf("TextScanner") != -1) {                            System.out.println("DELETAR field"+field);                        }                        cg.removeField(fields[i]);                    }                }        //          } else {                //Classes com nomes com o caracter $                //System.out.println(className);    //        }            Attribute[] attrs = cg.getAttributes();            for (int i = 0; i < attrs.length; i++) {                if (attrs[i] instanceof SourceFile) {                    //TODO                    //cg.removeAttribute(attrs[i]);                } else {                    //System.out.println(attrs[i]);                }            }            this.updateClassGen(cg);            cg.update();            cg.getJavaClass().accept(new ConstantPoolCleanerVisitor());            this.dump(cg.getJavaClass());            if (eClazz.hasChildNodes()) {                File directory = configurator.getReportDirectory();                directory.mkdirs();                File report = new File(directory, className + ".xml");                javax.xml.transform.Transformer trans = TransformerFactory                        .newInstance().newTransformer();                trans.setOutputProperty(OutputKeys.INDENT, "yes");                trans.transform(new DOMSource(document), new StreamResult(                        report));            }        }        log.debug("\n\n");    }