-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enforce NullAway for Guava packages #1570
Conversation
Generate changelog in
|
String methodName = method.element().getSimpleName().toString(); | ||
String originalMethodFieldName = CaseFormat.LOWER_CAMEL | ||
String originalMethodFieldName = Strings.nullToEmpty(CaseFormat.LOWER_CAMEL | ||
.converterTo(CaseFormat.UPPER_UNDERSCORE) | ||
.convert(methodName); | ||
.convert(methodName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
methodName
shouldn't ever be null, so I'm not sure exactly why this flags as possibly null. Going to switch this to a checkNotNull
to enforce that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the intent is that convert input is nullable, and the outputs nullability matches the input, but the annotations don't have a clear way to express that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was just a little surprised compiler couldn't verify this was always non-null as it flowed through. There's some interesting bits in Converter
and com.google.common.base.NullnessCasts#uncheckedCastNullableTToT
Released 0.53.0 |
Before this PR
NullAway
was not checking Guavacom.google.common
annotated packages. When enabling as a test for palantir/gradle-baseline#2382 it flagged one likely false positive that we can check.After this PR
==COMMIT_MSG==
Enforce NullAway for Guava packages
==COMMIT_MSG==
Possible downsides?