-
Notifications
You must be signed in to change notification settings - Fork 578
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
spotbugs reports VR_UNRESOLVABLE_REFERENCE when code is compiled with Java 11 #1254
Comments
Snippet to reproduce:
Settings:
Results with Java 11 (bad):
Results with Java 8 (good):
|
1 task
1 task
Fixed via #1334. |
1 task
This was referenced Mar 8, 2021
@iloveeclipse does this fix mean #811 can be closed? |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have some code with nested inner classes calling private methods in the outer class. As we are trying to compile our product with Java 11, we notice a ton of
VR_UNRESOLVABLE_REFERENCE
reports fromspotbugs
.This seems to boil down to JEP-181: https://openjdk.java.net/jeps/181
Synthetic accessors seem to be no longer necessary; the compiler does not generate them. From what I can tell, when code is compiled with Java 11,
ResolveAllReferences.visit()
falls into theConstantCP
case for method calls (CONSTANT_Methodref
) that previously needed synthetic accessors (but now no longer do). The method is not found, as its private (see howdefined
is filled inResolveAllReferences.addAllDefinitions()
).spotbugs
then reportsVR_UNRESOLVABLE_REFERENCE
, which is false; our product tests run just fine with the Java 11 compiled code.Example:
See my comment below for a reproducer.
The text was updated successfully, but these errors were encountered: