File tree 1 file changed +6
-6
lines changed
sootup.callgraph/src/main/java/sootup/callgraph
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -313,17 +313,17 @@ protected abstract void postProcessingMethod(
313
313
@ Nonnull
314
314
@ Override
315
315
public CallGraph addClass (@ Nonnull CallGraph oldCallGraph , @ Nonnull JavaClassType classType ) {
316
- MutableCallGraph updated = oldCallGraph .copy ();
317
-
318
316
SootClass <?> clazz = view .getClassOrThrow (classType );
319
317
Set <MethodSignature > newMethodSignatures =
320
- clazz .getMethods ().stream ().map (Method ::getSignature ).collect (Collectors .toSet ());
318
+ clazz .getMethods ().stream ().map (Method ::getSignature ).filter ( methodSig -> ! oldCallGraph . containsMethod ( methodSig )). collect (Collectors .toSet ());
321
319
322
- if ( newMethodSignatures . stream (). anyMatch ( oldCallGraph :: containsMethod )) {
323
- // FIXME: [ms] handle better - remove from entry point signatures in this case
324
- throw new IllegalArgumentException ( "CallGraph already contains methods from " + classType ) ;
320
+ // were all the added method signatures already visited in the CallGraph? i.e. is there something to add?
321
+ if ( newMethodSignatures . isEmpty ()) {
322
+ return oldCallGraph ;
325
323
}
326
324
325
+ MutableCallGraph updated = oldCallGraph .copy ();
326
+
327
327
// Step 1: Add edges from the new methods to other methods
328
328
Deque <MethodSignature > workList = new ArrayDeque <>(newMethodSignatures );
329
329
Set <MethodSignature > processed = new HashSet <>(oldCallGraph .getMethodSignatures ());
You can’t perform that action at this time.
0 commit comments