Versions:
- Eclipse 2020-06 (4.16)
- SonarLint for Eclipse 5.3.0
Stacktrace:
java.lang.StackOverflowError
at java.base/java.util.HashMap.hash(HashMap.java:339)
at java.base/java.util.HashMap.containsKey(HashMap.java:591)
at com.google.common.collect.AbstractMapBasedMultimap.containsKey(AbstractMapBasedMultimap.java:180)
at com.google.common.collect.ArrayListMultimap.containsKey(ArrayListMultimap.java:61)
at org.sonar.java.resolve.Scope.lookup(Scope.java:62)
at org.sonar.java.resolve.Resolve.findMemberType(Resolve.java:214)
at org.sonar.java.resolve.Resolve.findMemberType(Resolve.java:222)
at org.sonar.java.resolve.Resolve.findMemberType(Resolve.java:234)
[... last line repeats until end of log-message]
Eclipse shows a warning that requests eclipse to be restarted, but immediately after the restart (or every time the file is saved/build) the error is shown again. The error prevents eclipse from actually building the class so you don’t have access to the actual compiler error message.
Steps to reproduce
Create a class similar to this one:
package de.st_ddt.example;
public abstract class Test implements Test { // Implement itself
@Override // <-- This one is important
public abstract void testMethod();
}
I stumbled across this error after a broken refactor. The broken refactorcaused tons of errors in the code but due to the Stackoverflow during the build the other errors won’t get cleared up and I ended up searching the needle in the hay port. I had to remove Sonar to find the actual compile error.
Potential workaround:
- Fix the broken class/self-reference (if you are able to find them)