/** * Creates a new MemberAdder that will copy methods into the given target * class. * @param targetClass the class to which all visited class members * will be added. * @param nameTransformer the transformer to be applied to each member's * name before copying. If null, the original * name will be used. * @param extraMemberVisitor an optional member visitor that visits each * new member right after it has been added. This * allows changing the visitor info, for instance. */ public MemberAdder(ProgramClass targetClass, StringTransformer nameTransformer, MemberVisitor extraMemberVisitor) { this.targetClass = targetClass; this.nameTransformer = nameTransformer; this.extraMemberVisitor = extraMemberVisitor; classEditor = new ClassEditor(targetClass); constantPoolEditor = new ConstantPoolEditor(targetClass); }
/** * Creates a new MemberAdder that will copy methods into the given target * class. * @param targetClass the class to which all visited class members * will be added. * @param nameTransformer the transformer to be applied to each member's * name before copying. If null, the original * name will be used. * @param extraMemberVisitor an optional member visitor that visits each * new member right after it has been added. This * allows changing the visitor info, for instance. */ public MemberAdder(ProgramClass targetClass, StringTransformer nameTransformer, MemberVisitor extraMemberVisitor) { this.targetClass = targetClass; this.nameTransformer = nameTransformer; this.extraMemberVisitor = extraMemberVisitor; classEditor = new ClassEditor(targetClass); constantPoolEditor = new ConstantPoolEditor(targetClass); }
/** * Creates a new MemberAdder that will copy methods into the given target * class. * @param targetClass the class to which all visited class members * will be added. * @param nameTransformer the transformer to be applied to each member's * name before copying. If null, the original * name will be used. * @param extraMemberVisitor an optional member visitor that visits each * new member right after it has been added. This * allows changing the visitor info, for instance. */ public MemberAdder(ProgramClass targetClass, StringTransformer nameTransformer, MemberVisitor extraMemberVisitor) { this.targetClass = targetClass; this.nameTransformer = nameTransformer; this.extraMemberVisitor = extraMemberVisitor; classEditor = new ClassEditor(targetClass); constantPoolEditor = new ConstantPoolEditor(targetClass); }
public void visitProgramClass(ProgramClass programClass) { ClassEditor classEditor = new ClassEditor(programClass); // Remove all collected methods. for (Method method : methodsToRemove) { classEditor.removeMethod(method); } methodsToRemove.clear(); // Remove all collected fields. for (Field field : fieldsToRemove) { classEditor.removeField(field); } fieldsToRemove.clear(); }
public void visitProgramClass(ProgramClass programClass) { ClassEditor classEditor = new ClassEditor(programClass); // Remove all collected methods. for (Method method : methodsToRemove) { classEditor.removeMethod(method); } methodsToRemove.clear(); // Remove all collected fields. for (Field field : fieldsToRemove) { classEditor.removeField(field); } fieldsToRemove.clear(); }
public void visitProgramClass(ProgramClass programClass) { ClassEditor classEditor = new ClassEditor(programClass); // Remove all collected methods. for (Method method : methodsToRemove) { classEditor.removeMethod(method); } methodsToRemove.clear(); // Remove all collected fields. for (Field field : fieldsToRemove) { classEditor.removeField(field); } fieldsToRemove.clear(); }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
/** * Creates a new MemberAdder that will copy methods into the given target * class. * @param targetClass the class to which all visited class members will be * added. */ // * @param addFields specifies whether fields should be added, or fused // * with the present fields. public MemberAdder(ProgramClass targetClass)//), // boolean addFields) { this.targetClass = targetClass; // this.addFields = addFields; constantAdder = new ConstantAdder(targetClass); classEditor = new ClassEditor(targetClass); constantPoolEditor = new ConstantPoolEditor(targetClass); }
public void visitProgramClass(ProgramClass programClass) { if (DEBUG) { System.out.println("SimpleEnumClassSimplifier: ["+programClass.getName()+"]"); } // Unmark the class as an enum. programClass.u2accessFlags &= ~ClassConstants.ACC_ENUM; // Remove the valueOf method, if present. Method valueOfMethod = programClass.findMethod(ClassConstants.METHOD_NAME_VALUEOF, null); if (valueOfMethod != null) { new ClassEditor(programClass).removeMethod(valueOfMethod); } // Simplify the static initializer. programClass.methodAccept(ClassConstants.METHOD_NAME_CLINIT, ClassConstants.METHOD_TYPE_CLINIT, initializerSimplifier); }
public void visitProgramClass(ProgramClass programClass) { if (DEBUG) { System.out.println("SimpleEnumClassSimplifier: ["+programClass.getName()+"]"); } // Unmark the class as an enum. programClass.u2accessFlags &= ~ClassConstants.ACC_ENUM; // Remove the valueOf method, if present. Method valueOfMethod = programClass.findMethod(ClassConstants.METHOD_NAME_VALUEOF, null); if (valueOfMethod != null) { new ClassEditor(programClass).removeMethod(valueOfMethod); } // Simplify the static initializer. programClass.methodAccept(ClassConstants.METHOD_NAME_CLINIT, ClassConstants.METHOD_TYPE_CLINIT, initializerSimplifier); }
public void visitProgramClass(ProgramClass programClass) { if (DEBUG) { System.out.println("SimpleEnumClassSimplifier: ["+programClass.getName()+"]"); } // Unmark the class as an enum. programClass.u2accessFlags &= ~ClassConstants.ACC_ENUM; // Remove the valueOf method, if present. Method valueOfMethod = programClass.findMethod(ClassConstants.METHOD_NAME_VALUEOF, null); if (valueOfMethod != null) { new ClassEditor(programClass).removeMethod(valueOfMethod); } // Simplify the static initializer. programClass.methodAccept(ClassConstants.METHOD_NAME_CLINIT, ClassConstants.METHOD_TYPE_CLINIT, initializerSimplifier); }
null); ClassEditor classEditor = new ClassEditor(lambdaClass);
null); ClassEditor classEditor = new ClassEditor(lambdaClass);
null); ClassEditor classEditor = new ClassEditor(lambdaClass);