Skip to content
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

Assorted improvements to nullness annotations. #5918

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link
Contributor

@copybara-service copybara-service bot commented Feb 10, 2022

Assorted improvements to nullness annotations.

I don't think any of the Guava changes are user-visible.

Details:

  • Many of these fix bugs that will be noticed by the forthcoming version of our hacky internal nullness checker.
  • Some of these fix bugs that even the forthcoming version won't notice but that I happened to see.
  • Some changes add @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 quiet ReturnMissingNullable, at least until I quiet it for all such methods with ReturnMissingNullable should ignore @DoNotCall and always throwing methods error-prone#2910).
  • The NullnessCasts change is to discourage ReturnMissingNullable from adding a @Nullable annotation where we don't want it. (But we'll probably never run ReturnMissingNullable in the "aggressive" mode over this code, anyway, so there's not likely to be a need for the suppression.)
  • The @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.
  • The 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

I don't think any of the Guava changes are user-visible.

Details:
- Many of these fix bugs that will be noticed by the forthcoming version of our hacky internal nullness checker.
- Some of these fix bugs that even the forthcoming version won't notice but that I happened to see.
- Some changes add `@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 quiet `ReturnMissingNullable`, at least until I quiet it for all such methods with google/error-prone#2910).
- The `NullnessCasts` change is to discourage `ReturnMissingNullable` from adding a `@Nullable` annotation where we don't want it. (But we'll probably never run `ReturnMissingNullable` in the "aggressive" mode over this code, anyway, so there's not likely to be a need for the suppression.)
- The `@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.
- The `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
PiperOrigin-RevId: 421129392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant