/** Returns the first object in this Chain. */ @Override public E getFirst() { return innerChain.getFirst(); }
/** Removes the first object from this Chain. */ @Override public void removeFirst() { remove(innerChain.getFirst()); }
Unit entryPoint = unitChain.getFirst(); if (!heads.contains(entryPoint)) { heads.add(entryPoint);
Unit entryPoint = unitChain.getFirst(); if (!heads.contains(entryPoint)) { heads.add(entryPoint);
private void printStatementsInBody(Body body, java.io.PrintWriter out) { if (Options.v().verbose()) { System.out.println("Printing " + body.getMethod().getName()); } Chain<Unit> units = ((DavaBody) body).getUnits(); if (units.size() != 1) { throw new RuntimeException("DavaBody AST doesn't have single root."); } UnitPrinter up = new DavaUnitPrinter((DavaBody) body); ((ASTNode) units.getFirst()).toString(up); out.print(up.toString()); }
Unit trueHead = units.getFirst();
ASTNode AST = (ASTNode) units.getFirst(); if (!(AST instanceof ASTMethodNode)) { throw new RuntimeException("Starting node of DavaBody AST is not an ASTMethodNode");
if (block.getHead() == mUnits.getFirst()) {
public void staticBlockInlining(SootClass sootClass) { this.sootClass = sootClass; // retrieve the clinit method if any for sootClass // the clinit method gets converted into the static block which could initialize the final variable if (!sootClass.declaresMethod("void <clinit>()")) { // System.out.println("no clinit"); return; } SootMethod clinit = sootClass.getMethod("void <clinit>()"); // System.out.println(clinit); // retireve the active body if (!clinit.hasActiveBody()) { throw new RuntimeException("method " + clinit.getName() + " has no active body!"); } Body clinitBody = clinit.getActiveBody(); Chain units = ((DavaBody) clinitBody).getUnits(); if (units.size() != 1) { throw new RuntimeException("DavaBody AST doesn't have single root."); } ASTNode AST = (ASTNode) units.getFirst(); if (!(AST instanceof ASTMethodNode)) { throw new RuntimeException("Starting node of DavaBody AST is not an ASTMethodNode"); } // running methodCallFinder on the Clinit method AST.apply(new MethodCallFinder(this)); }
Stmt stmt = (Stmt) units.getFirst();
ASTNode ASTtemp = (ASTNode) units.getFirst(); if (!(ASTtemp instanceof ASTMethodNode)) { throw new RuntimeException("Starting node of DavaBody AST is not an ASTMethodNode");
if (units.getFirst() != newTarget) { Unit prev = (Unit) units.getPredOf(newTarget); if (prev != null && prev.fallsThrough()) {
public static void updateTraps(Unit oldu, Unit newu, Chain<Trap> traps) { int size = traps.size(); if (size == 0) { return; } Trap t = traps.getFirst(); do { if (t.getBeginUnit() == oldu) { t.setBeginUnit(newu); } if (t.getEndUnit() == oldu) { t.setEndUnit(newu); } if (t.getHandlerUnit() == oldu) { t.setHandlerUnit(newu); } } while ((--size > 0) && (t = traps.getSuccOf(t)) != null); }
ASTNode AST = (ASTNode) units.getFirst(); if (!(AST instanceof ASTMethodNode)) { throw new RuntimeException("Starting node of DavaBody AST is not an ASTMethodNode");
Map<Unit, List<Unit>> unitToPreds, boolean omitExceptingUnitEdges) { Set<Unit> trapsThatAreHeads = new ArraySet<Unit>(); Unit entryPoint = unitChain.getFirst(); for (Entry<Unit, Collection<ExceptionDest>> entry : unitToExceptionDests.entrySet()) { Unit thrower = entry.getKey();
if (currentStmt != units.getFirst()) { if (unitGraph.getSuccsOf(previousStmt).size() != 1 || unitGraph.getPredsOf(currentStmt).size() != 1 || up.labels().containsKey(currentStmt)) {
int numPruned = units.size(); Set<Unit> reachable = units.isEmpty() ? Collections.<Unit>emptySet() : reachable(units.getFirst(), graph);
for (s = (Stmt) units.getFirst(); s != null; s = (Stmt) units.getSuccOf(s)) { if (!(s instanceof IfStmt)) { continue;