-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECJ writes incorrect enclosing method for doubly-nested anonymous class #1905
Comments
Simple version (without any dependencies):
Javac from 17 / 21 is fine with that:
Ecj as of today master (also running on same Java 21):
ecj encodes wrong outer class name that contains method name:
expected:
|
3 tasks
JLS 4.7.7 The EnclosingMethod Attribute
...
|
robstryker
pushed a commit
to robstryker/eclipse.jdt.core
that referenced
this issue
Jul 18, 2024
…ss (eclipse-jdt#1906) * Do not traverse past enclosing type declaration to compute enclosing method * Fixes eclipse-jdt#1905
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following test crashes in Eclipse 2023-12 with java.lang.InternalError: Enclosing method not found:
My version of JDT is 3.19.300.v20231201-0110.
Eclipse is running on JDK-21: org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_21.0.1.v20231028-0937
The test is running on JDK-17: org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_17.0.3.v20220515-1416
The test passes (I believe correctly) when compiled and run with javac (pick either from the above JDKs).
If I open the innermost class file (
BugTest$1$1.class
) generated by each of ecj and javac in Eclipse's raw class viewer, I see that ecj has a different value for the enclosing method:javac's:
ecj's:
The text was updated successfully, but these errors were encountered: