-
Notifications
You must be signed in to change notification settings - Fork 737
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
RestrictedApiChecker: java.util.NoSuchElementException at com.sun.tools.javac.code.Scope$ScopeImpl$1.next(Scope.java:592) #2099
Comments
Thanks for the report and the repro! I can observe the same crash with this smaller example: package t;
class T {
static class Foo {
class Loo {}
}
public void testFoo(Foo foo) {
foo.new Loo() {};
}
}
|
It looks like the AST for error-prone/core/src/main/java/com/google/errorprone/bugpatterns/RestrictedApiChecker.java Line 111 in eee9fff
|
I found the change between 8 and 9 that's causing this: |
to avoid preventing workarounds for crashes like #2099 PiperOrigin-RevId: 351906045
to avoid preventing workarounds for crashes like #2099 PiperOrigin-RevId: 351906045
to avoid preventing workarounds for crashes like #2099 PiperOrigin-RevId: 351906045
to avoid preventing workarounds for crashes like #2099 PiperOrigin-RevId: 351906045
`NewClassTree.getEnclosingInstance` doesn't work in JDK 8, because it gets desugared in an early pass before Error Prone runs. This change adds a workaround that detects `NewClassTree` by looking at the synthetic parameter added by the desugaring pass instead of using `getEnclosingInstance`. Fixes #2099 PiperOrigin-RevId: 351909719
to avoid preventing workarounds for crashes like #2099 PiperOrigin-RevId: 351919242
`NewClassTree.getEnclosingInstance` doesn't work in JDK 8, because it gets desugared in an early pass before Error Prone runs. This change adds a workaround that detects `NewClassTree` by looking at the synthetic parameter added by the desugaring pass instead of using `getEnclosingInstance`. Fixes #2099 PiperOrigin-RevId: 351909719
`NewClassTree.getEnclosingInstance` doesn't work in JDK 8, because it gets desugared in an early pass before Error Prone runs. This change adds a workaround that detects `NewClassTree` by looking at the synthetic parameter added by the desugaring pass instead of using `getEnclosingInstance`. Fixes #2099 PiperOrigin-RevId: 351909719
to avoid preventing workarounds for crashes like google#2099 PiperOrigin-RevId: 351919242
`NewClassTree.getEnclosingInstance` doesn't work in JDK 8, because it gets desugared in an early pass before Error Prone runs. This change adds a workaround that detects `NewClassTree` by looking at the synthetic parameter added by the desugaring pass instead of using `getEnclosingInstance`. Fixes google#2099 PiperOrigin-RevId: 351921606
Description of the problem / feature request:
After upgrading errorprone from 2.4.0 to 2.5.0 following is reported using ant build (with JDK8):
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
This sample code is simplified and the non-static inner class raises the issue!
What version of Error Prone are you using?
2.5.0
The text was updated successfully, but these errors were encountered: