Instruction[] instructions = this.findInvokeInstructions(mg); ConstantPoolGen pool = mg.getConstantPool(); Method[] ms = this.instructionToMethod( (InvokeInstruction[]) instructions, pool); for (int i = 0; i < ms.length; i++) { if (ms[i].getName().equals("forName") && ms[i].getClassName().equals("java.lang.Class")) { this.analiseMethodThatUseClassForName(method);
LoadClass[] loadClasses= this.findLoadClassInstructions(methodGen); ConstantPoolGen pool = methodGen.getConstantPool(); for (int i = 0; i < loadClasses.length; i++) { if (loadClasses[i] instanceof InvokeInstruction) { InvokeInstruction instruction= (InvokeInstruction) loadClasses[i]; Method methodTemp= new Method(instruction.getClassName(pool), instruction.getName(pool), instruction.getSignature(pool)); if (usedMethods.contains(methodTemp)) { continue; } methodTemp= ClassUtils.findMethod(configurator, classes, instruction.getClassName(pool), instruction.getName(pool), instruction.getSignature(pool)); if (methodTemp.getName().equals("forName") && methodTemp.getClassName().equals("java.lang.Class")) { this.analiseMethodThatUseClassForName(method); }  if (configurator.inspect(methodTemp)) { this.analyse(methodTemp, usedMethods); } else { usedMethods.add(methodTemp); } } else if (loadClasses[i] instanceof FieldInstruction) { FieldInstruction fieldInstruction = (FieldInstruction) loadClasses[i]; className = fieldInstruction.getClassName(pool); usedMethods.add(new Field(className, fieldInstruction.getName(pool), fieldInstruction.getSignature(pool))); this.buildHierachyTree(className); } else { ObjectType objectType= loadClasses[i].getLoadClassType(pool);  if (objectType != null) { className= objectType.getClassName();  this.buildHierachyTree(className); }
    public void analyse(Method method, Set usedMethods)            throws ClassNotFoundException {        if (!usedMethods.contains(method)) {            if (classes.add(method.getClassName())) {            	//used just to relax de user            	log.info("Analysing class: "+method.getClassName());            }            usedMethods.add(method);            MethodGen mg = method.toMethodGen();            if (mg.isNative()) {            	log.trace("Native method: "+ method.toString());                return;            }            if (mg.isAbstract()) {            	log.trace("Abstract method: "+ method.toString());            	return;            }            Instruction[] instructions = this.findInvokeInstructions(mg);            ConstantPoolGen pool = mg.getConstantPool();            Method[] ms = this.instructionToMethod(                    (InvokeInstruction[]) instructions, pool);            for (int i = 0; i < ms.length; i++) {                if (ms[i].getName().equals("forName")                        && ms[i].getClassName().equals("java.lang.Class")) {                    this.analiseMethodThatUseClassForName(method);                }                // test with this method should be analyse                if (inspecter.inspect(ms[i])) {                    this.analyse(ms[i], usedMethods);                } else {                    usedMethods.add(ms[i]);                }            }            instructions = this.findFieldInstructions(mg);            // Look up for use of fields.             for (int i = 0; i < instructions.length; i++) {                FieldInstruction fi = (FieldInstruction) instructions[i];                String className = fi.getClassName(pool);                usedMethods.add(new Field(className, fi.getName(pool), fi                        .getSignature(pool)));                classes.add(className);            }        }    }