@Override public String toString() { return super.toString() + "\n\ton Path: " + getAbstractionPath(); } }
@Override public void run() { Stack<Pair<Stmt, Set<Abstraction>>> initialStack = new Stack<Pair<Stmt, Set<Abstraction>>>(); initialStack.push(new Pair<Stmt, Set<Abstraction>>(null, Collections.newSetFromMap(new IdentityHashMap<Abstraction, Boolean>()))); for (SourceContextAndPath context : getPaths(lastTaskId++, abs.getAbstraction(), initialStack)) { results.addResult(abs.getSinkDefinition(), abs.getAbstraction().getAccessPath(), abs.getSinkStmt(), context.getDefinition(), context.getAccessPath(), context.getStmt(), context.getUserData(), context.getAbstractionPath()); } }
/** * Checks whether the given abstraction is a source. If so, a result entry is * created. * * @param abs * The abstraction to check * @param scap * The path leading up to the current abstraction * @return True if the current abstraction is a source, otherwise false */ private boolean checkForSource(Abstraction abs, SourceContextAndPath scap) { if (abs.getPredecessor() != null) return false; // If we have no predecessors, this must be a source assert abs.getSourceContext() != null; assert abs.getNeighbors() == null; // Register the source that we have found SourceContext sourceContext = abs.getSourceContext(); results.addResult(scap.getDefinition(), scap.getAccessPath(), scap.getStmt(), sourceContext.getDefinition(), sourceContext.getAccessPath(), sourceContext.getStmt(), sourceContext.getUserData(), scap.getAbstractionPath()); return true; }
/** * Checks whether the given abstraction is a source. If so, a result entry is * created. * * @param abs The abstraction to check * @param scap The path leading up to the current abstraction * @return True if the current abstraction is a source, otherwise false */ protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap) { if (abs.getPredecessor() != null) return false; // If we have no predecessors, this must be a source assert abs.getSourceContext() != null; // A source should normally never have neighbors, but it can happen // with ICCTA if (abs.getNeighbors() != null) { // we ignore this issue for now, because the neighbor's source // contexts seem to be equal to our own one } // Register the source that we have found SourceContext sourceContext = abs.getSourceContext(); Pair<ResultSourceInfo, ResultSinkInfo> newResult = results.addResult(scap.getDefinition(), scap.getAccessPath(), scap.getStmt(), sourceContext.getDefinition(), sourceContext.getAccessPath(), sourceContext.getStmt(), sourceContext.getUserData(), scap.getAbstractionPath()); // Notify our handlers if (resultAvailableHandlers != null) for (OnPathBuilderResultAvailable handler : resultAvailableHandlers) handler.onResultAvailable(newResult.getO1(), newResult.getO2()); return true; }