public MethodOrMethodContext next() { Edge e = edges.next(); return e.getSrc(); }
public boolean hasNext() { if (position.getSrc() != m) { return false; } if (position.kind() == Kind.INVALID) { return false; } return true; }
/** * Used to add an edge to the call graph. Returns true iff the edge was not already present. */ public boolean addEdge(Edge e) { if (!edges.add(e)) { return false; } stream.add(e); Edge position = null; position = srcUnitToEdge.get(e.srcUnit()); if (position == null) { srcUnitToEdge.put(e.srcUnit(), e); position = dummy; } e.insertAfterByUnit(position); position = srcMethodToEdge.get(e.getSrc()); if (position == null) { srcMethodToEdge.put(e.getSrc(), e); position = dummy; } e.insertAfterBySrc(position); position = tgtToEdge.get(e.getTgt()); if (position == null) { tgtToEdge.put(e.getTgt(), e); position = dummy; } e.insertAfterByTgt(position); return true; }
/** * Removes the edge e from the call graph. Returns true iff the edge was originally present in the call graph. */ public boolean removeEdge(Edge e) { if (!edges.remove(e)) { return false; } srcMap.remove(e.getSrc(), e); tgtMap.remove(e.getTgt(), e); unitMap.remove(e.srcUnit(), e); return true; }
/** * Used to add an edge to the call graph. Returns true iff the edge was not already present. */ public boolean addEdge(Edge e) { if (!edges.add(e)) { return false; } stream.add(e); srcMap.put(e.getSrc(), e); tgtMap.put(e.getTgt(), e); unitMap.put(e.srcUnit(), e); return true; }
/** * Causes the QueueReader objects to be filled up with any methods that have become reachable since the last call. */ public void update() { while (edgeSource.hasNext()) { Edge e = edgeSource.next(); if (set.contains(e.getSrc())) { addMethod(e.getTgt()); } } while (unprocessedMethods.hasNext()) { MethodOrMethodContext m = unprocessedMethods.next(); Iterator<Edge> targets = cg.edgesOutOf(m); if (filter != null) { targets = filter.wrap(targets); } addMethods(new Targets(targets)); } }
"CallGraph: Source Type: " + callEdge.kind() + " Source Method/Context: " + callEdge.getSrc().toString(), src, methodCaller.getDeclaringClass().getName(), "Call Graph"));
/** * Swaps an invocation statement. All edges that previously went from the given statement to some callee now go from the * new statement to the same callee. This method is intended to be used when a Jimple statement is replaced, but the * replacement does not semantically affect the edges. * * @param out * The old statement * @param in * The new statement * @return True if at least one edge was affected by this operation */ public boolean swapEdgesOutOf(Stmt out, Stmt in) { boolean hasSwapped = false; for (QueueReader<Edge> edgeRdr = listener(); edgeRdr.hasNext();) { Edge e = edgeRdr.next(); if (e.srcUnit() == out) { removeEdge(e); addEdge(new Edge(e.getSrc(), in, e.getTgt())); hasSwapped = true; } } return hasSwapped; }
public Object next() { Edge e = (Edge) edges.next(); return e.getSrc(); } public void remove() { throw new UnsupportedOperationException(); }
public Object next() { Edge e = (Edge) edges.next(); return e.getSrc(); } public void remove() { throw new UnsupportedOperationException(); }
public boolean hasNext() { if( position.getSrc() != m ) return false; if( position.kind() == Kind.INVALID ) return false; return true; } public Edge next() {
public boolean hasNext() { if( position.getSrc() != m ) return false; if( position.kind() == Kind.INVALID ) return false; return true; } public Edge next() {
/** Removes the edge e from the call graph. Returns true iff the edge * was originally present in the call graph. */ public boolean removeEdge( Edge e ) { if( !edges.remove( e ) ) return false; e.remove(); if( srcUnitToEdge.get(e.srcUnit()) == e ) { if( e.nextByUnit().srcUnit() == e.srcUnit() ) { srcUnitToEdge.put(e.srcUnit(), e.nextByUnit() ); } else { srcUnitToEdge.put(e.srcUnit(), null); } } if( srcMethodToEdge.get(e.getSrc()) == e ) { if( e.nextBySrc().getSrc() == e.getSrc() ) { srcMethodToEdge.put(e.getSrc(), e.nextBySrc() ); } else { srcMethodToEdge.put(e.getSrc(), null); } } if( tgtToEdge.get(e.getTgt()) == e ) { if( e.nextByTgt().getTgt() == e.getTgt() ) { tgtToEdge.put(e.getTgt(), e.nextByTgt() ); } else { tgtToEdge.put(e.getTgt(), null); } } return true; }
/** Removes the edge e from the call graph. Returns true iff the edge * was originally present in the call graph. */ public boolean removeEdge( Edge e ) { if( !edges.remove( e ) ) return false; srcMap.remove(e.getSrc(), e); tgtMap.remove(e.getTgt(), e); unitMap.remove(e.srcUnit(), e); return true; }
/** Removes the edge e from the call graph. Returns true iff the edge * was originally present in the call graph. */ public boolean removeEdge( Edge e ) { if( !edges.remove( e ) ) return false; srcMap.remove(e.getSrc(), e); tgtMap.remove(e.getTgt(), e); unitMap.remove(e.srcUnit(), e); return true; }
/** Causes the QueueReader objects to be filled up with any methods * that have become reachable since the last call. */ public void update() { while(edgeSource.hasNext()) { Edge e = (Edge) edgeSource.next(); if( set.contains( e.getSrc() ) ) addMethod( e.getTgt() ); } while(unprocessedMethods.hasNext()) { MethodOrMethodContext m = (MethodOrMethodContext) unprocessedMethods.next(); Iterator<Edge> targets = cg.edgesOutOf( m ); if( filter != null ) targets = filter.wrap( targets ); addMethods( new Targets( targets ) ); } } /** Returns a QueueReader object containing all methods found reachable
/** Causes the QueueReader objects to be filled up with any methods * that have become reachable since the last call. */ public void update() { while(edgeSource.hasNext()) { Edge e = (Edge) edgeSource.next(); if( set.contains( e.getSrc() ) ) addMethod( e.getTgt() ); } while(unprocessedMethods.hasNext()) { MethodOrMethodContext m = (MethodOrMethodContext) unprocessedMethods.next(); Iterator<Edge> targets = cg.edgesOutOf( m ); if( filter != null ) targets = filter.wrap( targets ); addMethods( new Targets( targets ) ); } } /** Returns a QueueReader object containing all methods found reachable
/** Used to add an edge to the call graph. Returns true iff the edge was * not already present. */ public boolean addEdge( Edge e ) { if( !edges.add( e ) ) return false; stream.add( e ); srcMap.put( e.getSrc(), e ); tgtMap.put( e.getTgt(), e ); unitMap.put( e.srcUnit(), e ); return true; } /** Removes the edge e from the call graph. Returns true iff the edge
/** Used to add an edge to the call graph. Returns true iff the edge was * not already present. */ public boolean addEdge( Edge e ) { if( !edges.add( e ) ) return false; stream.add( e ); srcMap.put( e.getSrc(), e ); tgtMap.put( e.getTgt(), e ); unitMap.put( e.srcUnit(), e ); return true; } /** Removes the edge e from the call graph. Returns true iff the edge