private static soot.Local getLocalOfType(soot.Body body, soot.Type type) { soot.FastHierarchy fh = InitialResolver.v().hierarchy(); Iterator stmtsIt = body.getUnits().iterator(); soot.Local correctLocal = null; while (stmtsIt.hasNext()) { soot.jimple.Stmt s = (soot.jimple.Stmt) stmtsIt.next(); if (s instanceof soot.jimple.IdentityStmt && (s.hasTag("EnclosingTag") || s.hasTag("QualifyingTag"))) { Iterator it = s.getDefBoxes().iterator(); while (it.hasNext()) { soot.ValueBox vb = (soot.ValueBox) it.next(); if ((vb.getValue() instanceof soot.Local) && (fh.canStoreType(type, vb.getValue().getType()))) { // (vb.getValue().getType().equals(type))){ correctLocal = (soot.Local) vb.getValue(); } } } } return correctLocal; }
private static boolean bodyHasLocal(soot.Body body, soot.Type type) { soot.FastHierarchy fh = InitialResolver.v().hierarchy(); Iterator stmtsIt = body.getUnits().iterator(); while (stmtsIt.hasNext()) { soot.jimple.Stmt s = (soot.jimple.Stmt) stmtsIt.next(); if (s instanceof soot.jimple.IdentityStmt && (s.hasTag("EnclosingTag") || s.hasTag("QualifyingTag"))) { Iterator it = s.getDefBoxes().iterator(); while (it.hasNext()) { soot.ValueBox vb = (soot.ValueBox) it.next(); if ((vb.getValue() instanceof soot.Local) && (fh.canStoreType(type, vb.getValue().getType()))) { // (vb.getValue().getType().equals(type))){ return true; } } } } return false; /* * soot.FastHierarchy fh = InitialResolver.v().hierarchy(); Iterator it = body.getDefBoxes().iterator(); while * (it.hasNext()){ soot.ValueBox vb = (soot.ValueBox)it.next(); if ((vb.getValue() instanceof soot.Local) && * (fh.canStoreType(type, vb.getValue().getType()))){//(vb.getValue().getType().equals(type))){ return true; } } return * false; */ }
s = (Stmt) body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")) { LineNumberTag tag = (LineNumberTag) s.getTag("LineNumberTag"); lineToMeth.put(new Integer(tag.getLineNumber()), meth); s = (Stmt) body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")) { LineNumberTag tag = (LineNumberTag) s.getTag("LineNumberTag"); int line_num = tag.getLineNumber() - 1;
@Override public String toString() { StringBuilder sb = new StringBuilder(stmt.toString()); if (stmt.hasTag("LineNumberTag")) sb.append(" on line ").append(((LineNumberTag) stmt.getTag("LineNumberTag")).getLineNumber()); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(stmt == null ? accessPath.toString() : stmt.toString()); if (stmt != null && stmt.hasTag("LineNumberTag")) sb.append(" on line ").append(((LineNumberTag) stmt.getTag("LineNumberTag")).getLineNumber()); return sb.toString(); }
s = (Stmt)body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")){ LineNumberTag tag = (LineNumberTag)s.getTag("LineNumberTag"); lineToMeth.put(new Integer(tag.getLineNumber()), meth); s = (Stmt)body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")){ LineNumberTag tag = (LineNumberTag)s.getTag("LineNumberTag"); int line_num = tag.getLineNumber() - 1;
s = (Stmt)body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")){ LineNumberTag tag = (LineNumberTag)s.getTag("LineNumberTag"); lineToMeth.put(new Integer(tag.getLineNumber()), meth); s = (Stmt)body.getUnits().getSuccOf(s); if (s.hasTag("LineNumberTag")){ LineNumberTag tag = (LineNumberTag)s.getTag("LineNumberTag"); int line_num = tag.getLineNumber() - 1;