|
23 | 23 | import com.ibm.wala.cast.ir.ssa.AstIRFactory;
|
24 | 24 | import com.ibm.wala.cast.java.translator.jdt.ecj.ECJClassLoaderFactory;
|
25 | 25 | import com.ibm.wala.classLoader.CallSiteReference;
|
26 |
| -import com.ibm.wala.classLoader.IClass; |
27 |
| -import com.ibm.wala.classLoader.IMethod; |
28 | 26 | import com.ibm.wala.ipa.callgraph.*;
|
29 | 27 | import com.ibm.wala.ipa.callgraph.AnalysisOptions.ReflectionOptions;
|
30 | 28 | import com.ibm.wala.ipa.callgraph.impl.Util;
|
|
37 | 35 | import com.ibm.wala.ipa.slicer.SDG;
|
38 | 36 | import com.ibm.wala.ipa.slicer.Slicer;
|
39 | 37 | import com.ibm.wala.ipa.slicer.Statement;
|
40 |
| -import com.ibm.wala.ssa.IR; |
41 | 38 | import com.ibm.wala.types.ClassLoaderReference;
|
42 | 39 | import com.ibm.wala.util.collections.HashMapFactory;
|
43 | 40 | import com.ibm.wala.util.graph.Graph;
|
@@ -79,7 +76,6 @@ private static JSONExporter<Pair<String, Callable>, AbstractGraphEdge> getGraphE
|
79 | 76 | return gson.toJson(vertex);
|
80 | 77 | }
|
81 | 78 | );
|
82 |
| -// exporter.setVertexAttributeProvider(v -> v.getRight().getAttributes()); |
83 | 79 | exporter.setEdgeAttributeProvider(AbstractGraphEdge::getAttributes);
|
84 | 80 | return exporter;
|
85 | 81 | }
|
@@ -155,41 +151,6 @@ private static org.jgrapht.Graph<Pair<String, Callable>, AbstractGraphEdge> buil
|
155 | 151 | }
|
156 | 152 | }
|
157 | 153 | }));
|
158 |
| - |
159 |
| - callGraph.getEntrypointNodes() |
160 |
| - .forEach(p -> { |
161 |
| - // Get call statements that may execute in a given method |
162 |
| - Iterator<CallSiteReference> outGoingCalls = p.iterateCallSites(); |
163 |
| - outGoingCalls.forEachRemaining(n -> { |
164 |
| - callGraph.getPossibleTargets(p, n).stream() |
165 |
| - .filter(o -> AnalysisUtils.isApplicationClass(o.getMethod().getDeclaringClass())) |
166 |
| - .forEach(o -> { |
167 |
| - |
168 |
| - // Add the source nodes to the graph as vertices |
169 |
| - Pair<String, Callable> source = Optional.ofNullable(getCallableFromSymbolTable(p.getMethod())).orElseGet(() -> createAndPutNewCallableInSymbolTable(p.getMethod())); |
170 |
| - graph.addVertex(source); |
171 |
| - |
172 |
| - // Add the target nodes to the graph as vertices |
173 |
| - Pair<String, Callable> target = Optional.ofNullable(getCallableFromSymbolTable(o.getMethod())).orElseGet(() -> createAndPutNewCallableInSymbolTable(o.getMethod())); |
174 |
| - graph.addVertex(target); |
175 |
| - |
176 |
| - if (!source.equals(target) && source.getRight() != null && target.getRight() != null) { |
177 |
| - |
178 |
| - // Get the edge between the source and the target |
179 |
| - AbstractGraphEdge cgEdge = graph.getEdge(source, target); |
180 |
| - |
181 |
| - if (cgEdge == null) { |
182 |
| - graph.addEdge(source, target, new CallEdge()); |
183 |
| - } |
184 |
| - // If edge exists, then increment the weight |
185 |
| - else { |
186 |
| - cgEdge.incrementWeight(); |
187 |
| - } |
188 |
| - } |
189 |
| - }); |
190 |
| - }); |
191 |
| - }); |
192 |
| - |
193 | 154 | return graph;
|
194 | 155 | }
|
195 | 156 |
|
|
0 commit comments