Repository navigation
Promote @ElementTypesAreNonnullByDefault to the package level, replacing @ParametersAreNonnullByDefault. - #7566
Merged
Merged
Conversation
…acing `@ParametersAreNonnullByDefault`. We've annotated individual classes that haven't been annotated for nullness as `@NullUnmarked`. That will likely take precedence over `@ElementTypesAreNonnullByDefault`. Even if it does not, it will take precedence over `@NullMarked`, to which we will be migrating soon. I normally recommend annotating individual classes with `@NullMarked`, rather than packages. However, because Guava supports Java 8, and because users sometimes use reflection to inspect arbitrary annotations on Guava's classed (such as by using Mockito to mock them), there is some [danger](https://github.com/jspecify/jspecify/wiki/version-compatibility#runtime) in annotating individual classes with `@NullMarked`, whose [`@Target` includes `MODULE`](https://jspecify.dev/docs/api/org/jspecify/annotations/NullMarked.html), which isn't available under Java 8. RELNOTES=n/a PiperOrigin-RevId: 708300606
copybara-service
Bot
force-pushed
the
test_707958845
branch
from
December 20, 2024 14:11
e134759 to
5fe9d20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Promote
@ElementTypesAreNonnullByDefaultto the package level, replacing@ParametersAreNonnullByDefault.We've annotated individual classes that haven't been annotated for nullness as
@NullUnmarked. That will likely take precedence over@ElementTypesAreNonnullByDefault. Even if it does not, it will take precedence over@NullMarked, to which we will be migrating soon.I normally recommend annotating individual classes with
@NullMarked, rather than packages. However, because Guava supports Java 8, and because users sometimes use reflection to inspect arbitrary annotations on Guava's classed (such as by using Mockito to mock them), there is some danger in annotating individual classes with@NullMarked, whose@TargetincludesMODULE, which isn't available under Java 8.RELNOTES=n/a