Assorted improvements to nullness annotations. #5918
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assorted improvements to nullness annotations.
I don't think any of the Guava changes are user-visible.
Details:
@Nullable
to return types of methods that always throw an exception. There's no strict need for this, but we've mostly done it otherwise, so I figured I'd be consistent (and quietReturnMissingNullable
, at least until I quiet it for all such methods with ReturnMissingNullable should ignore @DoNotCall and always throwing methods error-prone#2910).NullnessCasts
change is to discourageReturnMissingNullable
from adding a@Nullable
annotation where we don't want it. (But we'll probably never runReturnMissingNullable
in the "aggressive" mode over this code, anyway, so there's not likely to be a need for the suppression.)@ParametricNullness
changes evidently aren't necessary for anyone right now, but they could theoretically be necessary for j2objc users until j2objc further enhances its support for nullness annotations.AbstractFuture
change removes a suppression that would be necessary under the Checker Framework (which would consider the supermethod's return type to be non-nullable) but isn't necessary for us (because we consider the supermethod's return type to have unspecified nullness).RELNOTES=n/a