Skip to content

Commit

Permalink
fix generics
Browse files Browse the repository at this point in the history
  • Loading branch information
swissiety committed Feb 2, 2024
1 parent 4df0dbe commit cea54ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
public class ICFGDotExporter {

public static String buildICFGGraph(
Map<MethodSignature, StmtGraph> signatureToStmtGraph, View view, CallGraph callGraph) {
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph, View view, CallGraph callGraph) {
final StringBuilder sb = new StringBuilder();
DotExporter.buildDiGraphObject(sb);
Map<Integer, MethodSignature> calls;
calls = computeCalls(signatureToStmtGraph, view, callGraph);
for (Map.Entry<MethodSignature, StmtGraph> entry : signatureToStmtGraph.entrySet()) {
for (Map.Entry<MethodSignature, StmtGraph<?>> entry : signatureToStmtGraph.entrySet()) {
String graph = DotExporter.buildGraph(entry.getValue(), true, calls, entry.getKey());
sb.append(graph + "\n");
sb.append(graph).append("\n");
}
sb.append("}");
return sb.toString();
Expand All @@ -58,10 +58,10 @@ public static String buildICFGGraph(
* methods.
*/
public static Map<Integer, MethodSignature> computeCalls(
Map<MethodSignature, StmtGraph> stmtGraphSet, View view, CallGraph callgraph) {
Map<MethodSignature, StmtGraph<?>> stmtGraphSet, View view, CallGraph callgraph) {
Map<Integer, MethodSignature> calls = new HashMap<>();
for (Map.Entry<MethodSignature, StmtGraph> entry : stmtGraphSet.entrySet()) {
StmtGraph stmtGraph = entry.getValue();
for (Map.Entry<MethodSignature, StmtGraph<?>> entry : stmtGraphSet.entrySet()) {
StmtGraph<?> stmtGraph = entry.getValue();
MethodSignature source = entry.getKey();
Collection<? extends BasicBlock<?>> blocks;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private Stmt filterEdgeAndGetCallerStmt(@Nonnull MethodSignature methodSignature
IDESolver.DEFAULT_CACHE_BUILDER.build(loaderMethodToCallers);

public JimpleBasedInterproceduralCFG(
View<? extends SootClass<?>> view,
View view,
MethodSignature mainMethodSignature,
boolean enableExceptions,
boolean includeReflectiveCalls) {
Expand All @@ -148,22 +148,22 @@ public JimpleBasedInterproceduralCFG(
}

public String buildICFGGraph(CallGraph callGraph) {
Map<MethodSignature, StmtGraph> signatureToStmtGraph = new LinkedHashMap<>();
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph = new LinkedHashMap<>();
computeAllCalls(mainMethodSignature, signatureToStmtGraph, callGraph);
return ICFGDotExporter.buildICFGGraph(signatureToStmtGraph, view, callGraph);
}

public void computeAllCalls(
MethodSignature methodSignature,
Map<MethodSignature, StmtGraph> signatureToStmtGraph,
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph,
CallGraph callGraph) {
ArrayList<MethodSignature> visitedMethods = new ArrayList<>();
computeAllCalls(methodSignature, signatureToStmtGraph, callGraph, visitedMethods);
}

private void computeAllCalls(
MethodSignature methodSignature,
Map<MethodSignature, StmtGraph> signatureToStmtGraph,
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph,
CallGraph callGraph,
List<MethodSignature> visitedMethods) {
visitedMethods.add(methodSignature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void ICFGInterfaceDotExport() {
/** Compute the Edges of the given methodSignature from the provided callGraph */
public String edgesFromCallGraph(
MethodSignature methodSignature, JimpleBasedInterproceduralCFG icfg, CallGraph callGraph) {
Map<MethodSignature, StmtGraph> signatureToStmtGraph = new LinkedHashMap<>();
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph = new LinkedHashMap<>();
icfg.computeAllCalls(methodSignature, signatureToStmtGraph, callGraph);
Map<Integer, MethodSignature> calls;
calls = ICFGDotExporter.computeCalls(signatureToStmtGraph, view, callGraph);
Expand Down

0 comments on commit cea54ea

Please sign in to comment.