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.
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.
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.
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
NullAwaywas not checking Guavacom.google.commonannotated 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?