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

Use @NullMarked instead of our custom @ElementTypesAreNonnullByDefault annotations. #7556

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

copybara-service[bot]
Copy link
Contributor

@copybara-service copybara-service bot commented Dec 18, 2024

Use @NullMarked instead of our custom @ElementTypesAreNonnullByDefault annotations.

This is the next step toward using JSpecify in Guava. At the end of that path, we'll be able to remove our dependency on JSR-305 (and on the Checker Framework's annotations), and we'll have one less blocker to providing a module-info.

@NullMarked allows tools like kotlinc to produce errors for code like ImmutableList<String?>. (Before releasing this change, I'll conduct some further testing to more fully characterize the effects, both under Kotlin 2.1 and prior.) As we make further changes, it will allow kotlinc to detect even more nullness problems. We will make these changes in a series of incremental releases so that users can pick them up gradually, as we did inside Google. In simple cases, users may wish to pick up all the changes at once instead by upgrading straight from Guava 33.4.0 (or an earlier version) to Guava 33.4.4 (or whatever the version to make the final changes ends up being).

RELNOTES=Replaced our custom @ElementTypesAreNonnullByDefault annotations with the JSpecify @NullMarked annotation.

@copybara-service copybara-service bot force-pushed the test_707134516 branch 8 times, most recently from 2630996 to 1b639e1 Compare December 21, 2024 14:26
…ault` annotations.

This is the next step toward [using JSpecify in Guava](jspecify/jspecify#239 (comment)). At the end of that path, we'll be able to [remove our dependency on JSR-305](#2960) (and on the Checker Framework's annotations), and we'll have one less blocker to [providing a `module-info`](#2970).

`@NullMarked` allows tools like kotlinc to produce errors for code like `ImmutableList<String?>`. (Before releasing this change, I'll conduct some further testing to more fully characterize the effects, both under Kotlin 2.1 and prior.) As we make further changes, it will allow kotlinc to detect even more nullness problems. We will make these changes in a series of incremental releases so that users can pick them up gradually, as we did inside Google. In simple cases, users may wish to pick up all the changes at once instead by upgrading straight from Guava 33.4.0 (or an earlier version) to Guava 33.4.4 (or whatever the version to make the final changes ends up being).

RELNOTES=Replaced our custom `@ElementTypesAreNonnullByDefault` annotations with the JSpecify `@NullMarked` annotation.
PiperOrigin-RevId: 708598410
@copybara-service copybara-service bot merged commit 8ebb375 into master Dec 21, 2024
@copybara-service copybara-service bot deleted the test_707134516 branch December 21, 2024 14:50
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