public List<String> returnCoreUnitsForProgram(){ ArrayList<String> testArray = new ArrayList<String>(); ProgramClass pc = new ProgramClass("","","",""); if ( pc.getProgramMajor().equals("Software Technology") || pc.getProgramMajor().equals("Network Technology" ) || pc.getProgramMajor().equals("Games Technology" ) ) { for(int i = 0; i< UnitArray.size() ; i++) { if (UnitArray.get(i).getUnitType().equals("Core")) testArray.add( UnitArray.get(i).getUnitName() ); } } return testArray; }
public void visitProgramClass(ProgramClass programClass) { referenceClassFound = false; programClass.constantPoolEntriesAccept(this); if (referenceClassFound) { programClass.accept(classVisitor); } }
public void visitProgramClass(ProgramClass programClass) { programClass.addSubClass(subclass); }
public void visitProgramClass(ProgramClass programClass) { // Mark the UTF-8 entries referenced by the other constant pool entries. programClass.constantPoolEntriesAccept(this); // Mark the UTF-8 entries referenced by the fields and methods. programClass.fieldsAccept(this); programClass.methodsAccept(this); // Mark the UTF-8 entries referenced by the attributes. programClass.attributesAccept(this); }
public void visitProgramClass(ProgramClass programClass) { programClass.attributesAccept(attributeVisitor); // Visit the attributes further down the class structure, if required. if (deep) { programClass.fieldsAccept(this); programClass.methodsAccept(this); programClass.attributesAccept(this); } }
public void visitProgramClass(ProgramClass programClass) { // Mark the NameAndType entries referenced by all other constant pool // entries. programClass.constantPoolEntriesAccept(this); // Mark the NameAndType entries referenced by all EnclosingMethod // attributes. programClass.attributesAccept(this); }
ClassConstants.INTERNAL_ACC_ABSTRACT)) || (isOnlySubClass(programClass, targetClass) && (programClass.getSuperClass().equals(targetClass) || programClass.getSuperClass().equals(targetClass.getSuperClass())))) && !targetClass.extendsOrImplements(programClass) && System.out.println(" Target interface? ["+((targetClass.getAccessFlags() & ClassConstants.INTERNAL_ACC_INTERFACE)!=0)+"]"); System.out.println(" Source subclasses ["+programClass.subClasses+"]"); System.out.println(" Target subclasses ["+targetClass.subClasses+"]"); System.out.println(" Source superclass ["+programClass.getSuperClass().getName()+"]"); System.out.println(" Target superclass ["+targetClass.getSuperClass().getName()+"]"); int targetAccessFlags = targetClass.getAccessFlags(); int sourceAccessFlags = programClass.getAccessFlags(); programClass.interfaceConstantsAccept( new ExceptClassConstantFilter(targetClass.getName(), new ImplementedClassConstantFilter(targetClass, new ImplementingClassConstantFilter(targetClass, new MemberAdder(targetClass); programClass.fieldsAccept(memberAdder); programClass.methodsAccept(memberAdder); programClass.attributesAccept( new AttributeAdder(targetClass, true));
/** * Creates a new SimplifiedClassEditor for the Java class with the given * name and super class. * * @param u2accessFlags access flags for the new class. * @param className the fully qualified name of the new class. * @param superclassName the fully qualified name of the super class. * * @see ClassConstants */ public SimplifiedClassEditor(int u2accessFlags, String className, String superclassName) { this(new ProgramClass(ClassConstants.CLASS_VERSION_1_2, 1, new Constant[10], u2accessFlags, 0, 0)); programClass.u2thisClass = constantPoolEditor.addClassConstant(className, programClass); if (superclassName != null) { programClass.u2superClass = constantPoolEditor.addClassConstant(superclassName, null); this.superClassName = superclassName; } }
public void visitProgramClass(ProgramClass programClass) { ConstantCounter counter = new ConstantCounter(); programClass.constantPoolEntriesAccept( new ConstantTagFilter(ClassConstants.CONSTANT_PrimitiveArray, counter)); // Replace PrimitiveArray constants if the class has any. if (counter.getCount() > 0) { classModified = false; programClass.methodsAccept(new AllAttributeVisitor(this)); if (classModified) { // Remove the now unused PrimitiveArray constants. programClass.accept(constantPoolShrinker); } } }
@Override public void visitProgramClass(ProgramClass programClass) { // Clear the fields from any previous runs. modified = false; bootstrapMethodIndexMap = new int[ClassConstants.TYPICAL_BOOTSTRAP_METHODS_ATTRIBUTE_SIZE]; // Remove any previous visitor info. programClass.accept(new ClassCleaner()); // Mark the bootstrap methods referenced by invokeDynamic instructions. programClass.methodsAccept(this); // Shrink the bootstrap methods attribute programClass.attributesAccept(this); if (modified) { // Clean up dangling and freed up constants programClass.accept(new ConstantPoolShrinker()); } }
programClass.accept(new LambdaExpressionCollector(lambdaExpressionMap)); injectedClassNameMap.put(programClass.getName(), lambdaClass.getName()); programClass.accept( new AllMethodVisitor( new AllAttributeVisitor( lambdaExpression.lambdaClass.accept( new MultiClassVisitor( new ClassSuperHierarchyInitializer(programClassPool, libraryClassPool), programClass.methodsAccept(this); memberRemover.visitProgramClass(programClass);
(InvokeDynamicConstant) programClass.getConstant(constantInstruction.constantIndex); concatenationConstants = null; programClass.attributesAccept(this); programClass.constantPoolEntryAccept(constantIndex, this); break;
public void visitProgramClass(ProgramClass programClass) { // Rename this class. programClass.thisClassConstantAccept(this); // Rename the class members. programClass.fieldsAccept(this); programClass.methodsAccept(this); }
public void visitProgramClass(ProgramClass programClass) { // Is this an abstract class or an interface? if ((programClass.getAccessFlags() & (ClassConstants.ACC_INTERFACE | ClassConstants.ACC_ABSTRACT)) != 0) { // Travel down the hierarchy. Clazz[] subClasses = programClass.subClasses; if (subClasses != null) { for (int index = 0; index < subClasses.length; index++) { subClasses[index].accept(this); } } } else { // Visit the class. Don't descend any further. programClass.accept(classVisitor); } }
public void visitProgramClass(ProgramClass programClass) { String oldName = programClass.getName(); String newName = ClassObfuscator.newClassName(programClass); if (newName != null && !oldName.equals(newName)) { programClass.u2accessFlags |= ClassConstants.ACC_RENAMED; } // Print out the class members. programClass.fieldsAccept(this); programClass.methodsAccept(this); }
private ProgramClass createUtilityClass(ProgramClass interfaceClazz) new ProgramClass(ClassConstants.CLASS_VERSION_1_2, 1, new Constant[10], 0); String utilityClassName = interfaceClazz.getName() + "$$Util"; ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(utilityClass, programClassPool, libraryClassPool);
public void visitProgramClass(ProgramClass programClass) { hasDefaultMethods = false; implClasses.clear(); // Collect all implementations of the interface. programClass.hierarchyAccept(false, false, false, true, new ProgramClassFilter( new ClassCollector(implClasses))); programClass.accept( new AllMethodVisitor( new MemberAccessFilter(0, ClassConstants.ACC_STATIC, new AllAttributeVisitor(this)))); if (hasDefaultMethods) { // Shrink the constant pool of unused constants. programClass.accept(new ConstantPoolShrinker()); } }
public void visitProgramClass(ProgramClass programClass) { // Sort the attributes. Arrays.sort(programClass.attributes, 0, programClass.u2attributesCount, this); // Sort the attributes of the class members. programClass.fieldsAccept(this); programClass.methodsAccept(this); }
ProgramField targetField = (ProgramField)targetClass.findField(name, descriptor); if (targetField != null) System.out.println("MemberAdder: renaming field ["+targetClass+"."+targetField.getName(targetClass)+" "+targetField.getDescriptor(targetClass)+"]"); constantPoolEditor.addUtf8Constant(newUniqueMemberName(name, targetClass.getName()));