AbstractMethodIterator(SootClass baseClass) { this.currClass = baseClass; this.next = null; this.methodIterator = baseClass.methodIterator(); this.findNextMethod(); }
private void releaseBodies(SootClass cl) { Iterator<SootMethod> methodIt = cl.methodIterator(); while (methodIt.hasNext()) { SootMethod m = methodIt.next(); if (m.hasActiveBody()) { m.releaseActiveBody(); } } }
/** Returns true if some method in this class has an active Baf body. */ public boolean containsBafBody() { Iterator<SootMethod> methodIt = methodIterator(); while (methodIt.hasNext()) { SootMethod m = methodIt.next(); if (m.hasActiveBody() && m.getActiveBody() instanceof soot.baf.BafBody) { return true; } } return false; }
public static List<SootMethod> getAllReachableMethods(SootClass sc) { ReachableMethods rm = Scene.v().getReachableMethods(); // Get list of reachable methods declared in this class List<SootMethod> allMethods = new ArrayList<SootMethod>(); Iterator methodsIt = sc.methodIterator(); while (methodsIt.hasNext()) { SootMethod method = (SootMethod) methodsIt.next(); if (rm.contains(method)) { allMethods.add(method); } } // Add reachable methods declared in superclasses SootClass superclass = sc; if (superclass.hasSuperclass()) { superclass = superclass.getSuperclass(); } while (superclass.hasSuperclass()) // we don't want to process Object { Iterator scMethodsIt = superclass.methodIterator(); while (scMethodsIt.hasNext()) { SootMethod scMethod = (SootMethod) scMethodsIt.next(); if (rm.contains(scMethod)) { allMethods.add(scMethod); } } superclass = superclass.getSuperclass(); } return allMethods; }
private void computeAverageMethodSizeAndSaveOriginalSizes() { long sum = 0, count = 0; Iterator classesIt = Scene.v().getApplicationClasses().iterator(); while (classesIt.hasNext()) { SootClass c = (SootClass) classesIt.next(); Iterator methodsIt = c.methodIterator(); while (methodsIt.hasNext()) { SootMethod m = (SootMethod) methodsIt.next(); if (m.isConcrete()) { int size = ((JimpleBody) m.retrieveActiveBody()).getUnits().size(); sum += size; methodToOriginalSize.put(m, new Integer(size)); count++; } } } if (count == 0) { return; } } }
Iterator scopeMethodsIt = sootClass.methodIterator(); while (scopeMethodsIt.hasNext()) { SootMethod scopeMethod = (SootMethod) scopeMethodsIt.next(); Iterator scMethodsIt = superclass.methodIterator(); while (scMethodsIt.hasNext()) { SootMethod scMethod = (SootMethod) scMethodsIt.next();
protected void internalTransform(String phaseName, Map<String, String> options) { lastClass = null; for (Iterator<SootClass> clIt = Scene.v().getApplicationClasses().iterator(); clIt.hasNext();) { final SootClass cl = clIt.next(); currentClass = cl; handleClass(cl); for (Iterator<SootMethod> it = cl.methodIterator(); it.hasNext();) { handleMethod(it.next()); } } Scene.v().setCallGraph(Scene.v().internalMakeCallGraph()); }
Iterator<SootMethod> methodIt = c.methodIterator(); while (methodIt.hasNext()) { ScanMethod(methodIt.next(), candidSet, fieldInfoTable);
Iterator<SootMethod> methodIt = methodIterator(); int methodCount = 0;
SootClass c = (SootClass) classIt.next(); Iterator methodIt = c.methodIterator();
Iterator<SootMethod> mtdIt = sc.methodIterator(); while (mtdIt.hasNext()) { SootMethod sm = mtdIt.next();
Iterator<SootMethod> methodIt = cl.methodIterator();
&& !currClass.getSuperclass().getName().equals("java.lang.Object")) { currClass = currClass.getSuperclass(); methodIterator = currClass.methodIterator(); continue; } else {
Iterator methodIt = s.methodIterator(); while (methodIt.hasNext()) { SootMethod m = (SootMethod) methodIt.next();
Iterator<SootMethod> methodIt = classIt.next().methodIterator(); while (methodIt.hasNext()) { SootMethod m = (SootMethod) methodIt.next();
Iterator<SootMethod> methodIt = cl.methodIterator();
Iterator methodIt = s.methodIterator(); while (methodIt.hasNext()) { SootMethod m = (SootMethod) methodIt.next();
for (Iterator it = c.methodIterator(); it.hasNext();) { methodsList.add(it.next());
Iterator<SootMethod> methodIt = sootClass.methodIterator();
Iterator<SootMethod> methodIterator = sc.methodIterator(); while (methodIterator.hasNext()) { SootMethod method = methodIterator.next();