Describe the bug
Running illegal name removal on certain samples throws StackOverflowError.
Specifically, the issue is in: if (parent.isLibraryMethod(name, desc))
in the following block:
public boolean isLibraryMethod(@Nonnull String name, @Nonnull String desc) {
// Check against this definition
if (!isPrimary && hasMethod(name, desc))
return true;
// Check parents.
// If we extend a class with a library definition then it should be considered a library method.
for (InheritanceVertex parent : getParents())
if (parent.isLibraryMethod(name, desc))
return true;
// No library definition found, so its safe to rename.
return false;
}
To Reproduce
Steps to reproduce the behavior:
- Open this sample in Recaf
- Run illegal name removal
- Refer to logs for stack overflow
Exception
If applicable, add the exception/stacktrace.
01:17:24.485 [MappingGenerator/JavaFX Application Thread] ERROR: Failed to generate mappings
java.util.concurrent.CompletionException: java.lang.StackOverflowError
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:359)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:364)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1791)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1781)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: java.lang.StackOverflowError
at software.coley.recaf.services.inheritance.InheritanceVertex.isLibraryMethod(InheritanceVertex.java:200)
at software.coley.recaf.services.inheritance.InheritanceVertex.isLibraryMethod(InheritanceVertex.java:206)
at software.coley.recaf.services.inheritance.InheritanceVertex.isLibraryMethod(InheritanceVertex.java:206)
at software.coley.recaf.services.inheritance.InheritanceVertex.isLibraryMethod(InheritanceVertex.java:206)
...
Screenshots
N/A
Describe the bug
Running illegal name removal on certain samples throws StackOverflowError.
Specifically, the issue is in:
if (parent.isLibraryMethod(name, desc))in the following block:
To Reproduce
Steps to reproduce the behavior:
Exception
If applicable, add the exception/stacktrace.
Screenshots
N/A