public Iterator<MethodOrMethodContext> iterator(Unit u) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator<Edge> it = cg.edgesOutOf(u); if (filter != null) { it = filter.wrap(it); } while (it.hasNext()) { Edge e = (Edge) it.next(); methods.add(e.getTgt()); } return iterator(methods.iterator()); }
public Iterator<MethodOrMethodContext> iterator(MethodOrMethodContext momc) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator<Edge> it = cg.edgesOutOf(momc); if (filter != null) { it = filter.wrap(it); } while (it.hasNext()) { Edge e = (Edge) it.next(); methods.add(e.getTgt()); } return iterator(methods.iterator()); }
private Iterator<MethodOrMethodContext> iterator(Set<MethodOrMethodContext> s, ArrayList<MethodOrMethodContext> worklist) { for (int i = 0; i < worklist.size(); i++) { MethodOrMethodContext method = worklist.get(i); Iterator<Edge> it = cg.edgesOutOf(method); if (filter != null) { it = filter.wrap(it); } while (it.hasNext()) { Edge e = (Edge) it.next(); if (s.add(e.getTgt())) { worklist.add(e.getTgt()); } } } return worklist.iterator(); } }
public ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints, Filter filter) { this.filter = filter; this.cg = graph; addMethods(entryPoints); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if (filter != null) { this.edgeSource = filter.wrap(this.edgeSource); } }
/** * 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)); } }
public Iterator<MethodOrMethodContext> iterator( MethodOrMethodContext momc ) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator it = cg.edgesOutOf( momc ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); methods.add( e.getTgt() ); } return iterator( methods.iterator() ); } public Iterator<MethodOrMethodContext> iterator( Iterator<MethodOrMethodContext> methods ) {
private Iterator<MethodOrMethodContext> iterator( Set<MethodOrMethodContext> s, ArrayList<MethodOrMethodContext> worklist ) { for( int i = 0; i < worklist.size(); i++ ) { MethodOrMethodContext method = worklist.get(i); Iterator it = cg.edgesOutOf( method ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); if( s.add( e.getTgt() ) ) worklist.add( e.getTgt() ); } } return worklist.iterator(); } }
public Iterator<MethodOrMethodContext> iterator( MethodOrMethodContext momc ) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator it = cg.edgesOutOf( momc ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); methods.add( e.getTgt() ); } return iterator( methods.iterator() ); } public Iterator<MethodOrMethodContext> iterator( Iterator<MethodOrMethodContext> methods ) {
public Iterator<MethodOrMethodContext> iterator( Unit u ) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator it = cg.edgesOutOf( u ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); methods.add( e.getTgt() ); } return iterator( methods.iterator() ); } public Iterator<MethodOrMethodContext> iterator( MethodOrMethodContext momc ) {
private Iterator<MethodOrMethodContext> iterator( Set<MethodOrMethodContext> s, ArrayList<MethodOrMethodContext> worklist ) { for( int i = 0; i < worklist.size(); i++ ) { MethodOrMethodContext method = worklist.get(i); Iterator it = cg.edgesOutOf( method ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); if( s.add( e.getTgt() ) ) worklist.add( e.getTgt() ); } } return worklist.iterator(); } }
public Iterator<MethodOrMethodContext> iterator( Unit u ) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator it = cg.edgesOutOf( u ); if( filter != null ) it = filter.wrap( it ); while( it.hasNext() ) { Edge e = (Edge) it.next(); methods.add( e.getTgt() ); } return iterator( methods.iterator() ); } public Iterator<MethodOrMethodContext> iterator( MethodOrMethodContext momc ) {
public ReachableMethods( CallGraph graph, Iterator<MethodOrMethodContext> entryPoints, Filter filter ) { this.filter = filter; this.cg = graph; addMethods( entryPoints ); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if( filter != null ) this.edgeSource = filter.wrap( this.edgeSource ); } public ReachableMethods( CallGraph graph, Collection<MethodOrMethodContext> entryPoints ) {
public ReachableMethods( CallGraph graph, Iterator<MethodOrMethodContext> entryPoints, Filter filter ) { this.filter = filter; this.cg = graph; addMethods( entryPoints ); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if( filter != null ) this.edgeSource = filter.wrap( this.edgeSource ); } public ReachableMethods( CallGraph graph, Collection<MethodOrMethodContext> entryPoints ) {
/** 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
Iterator<Edge> targets = filter.wrap(Scene.v().getCallGraph().edgesOutOf(m)); addMethods(new Targets(targets));