-
Notifications
You must be signed in to change notification settings - Fork 753
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
NPE analysing new style switch statement (2.14.0) #3225
Comments
Looks like a duplicate of #3220 |
carterkozak
added a commit
to palantir/gradle-baseline
that referenced
this issue
Jun 15, 2022
It has produced a substantially highter maintenance burden than we're willing to accept, impacting the error_prone version used in consumers before we're ready to adopt releases. For example, google/error-prone#3225 results in build failures when 2.14.0 is adopted.
This was referenced Jun 15, 2022
copybara-service bot
pushed a commit
that referenced
this issue
Aug 8, 2022
`ASTHelpers#getType(ClassTree)` and `ASTHelpers#targetType(VisitorState)` both may return null, which ImmutableChecker did not previously handle safely, which could lead to `NullPointerException` in cases such as switch expressions. This PR handles these potential `null` results more safely. Fixes #3220 & #3225 Fixes #3267 COPYBARA_INTEGRATE_REVIEW=#3267 from schlosna:ds/3220 dd8f38f PiperOrigin-RevId: 466185256
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Since upgrading to version 2.14.0, seeing the following NPE being thrown. It appears this is occurring whilst analysing a method with a new style switch statement where the result is a Supplier of an Optional. For example:
Changing this to an old-style switch statement prevents the NPE.
The text was updated successfully, but these errors were encountered: