Package com.rc.retroweaver.optimizer

Examples of com.rc.retroweaver.optimizer.ConstantPool


        ClassReader cr = new ClassReader(sourceStream);
        ClassWriter cw = new ClassWriter(true);

        try {
          NameTranslatorClassVisitor translator;
          ConstantPool cp;
            if (COMPACT_CONSTANTS) {
                cp = new ConstantPool();
                ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
                translator = new NameTranslatorClassVisitor(ccc);
            } else {
              translator = new NameTranslatorClassVisitor(cw);
            }
            ClassWeaver classWeaver = new ClassWeaver(translator, lazy, target, listener);
            SignatureStripper sigStripper = new SignatureStripper(classWeaver);
            cr.accept(sigStripper, false);       

            if (COMPACT_CONSTANTS) {
              Set<Constant> constants = new TreeSet<Constant>(new ConstantComparator());
              constants.addAll(cp.values());

              cr = new ClassReader(cw.toByteArray());
                cw = new ClassWriter(false);
                for(Constant c: constants)
                  c.write(cw);
View Full Code Here


        ClassReader cr = new ClassReader(sourceStream);
        ClassWriter cw = new ClassWriter(true);

        try {
          NameTranslatorClassVisitor translator;
          ConstantPool cp;
            if (COMPACT_CONSTANTS) {
                cp = new ConstantPool();
                ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
                translator = new NameTranslatorClassVisitor(ccc);
            } else {
              translator = new NameTranslatorClassVisitor(cw);
            }
            ClassWeaver classWeaver = new ClassWeaver(translator, lazy, stripAttributes, target, listener);
            ClassVisitor v;
            if (stripSignatures) {
                v = new SignatureStripper(classWeaver);
            } else {
              v = classWeaver;
            }
            cr.accept(v, CUSTOM_ATTRIBUTES, false);       

            if (COMPACT_CONSTANTS) {
              Set<Constant> constants = new TreeSet<Constant>(new ConstantComparator());
              constants.addAll(cp.values());

              cr = new ClassReader(cw.toByteArray());
                cw = new ClassWriter(false);
                for(Constant c: constants)
                  c.write(cw);
View Full Code Here

TOP

Related Classes of com.rc.retroweaver.optimizer.ConstantPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.