Migrate from jsr305 to jspecify nullability annotations#1398
Merged
bulldozer-bot[bot] merged 4 commits intodevelopfrom May 13, 2025
Merged
Migrate from jsr305 to jspecify nullability annotations#1398bulldozer-bot[bot] merged 4 commits intodevelopfrom
bulldozer-bot[bot] merged 4 commits intodevelopfrom
Conversation
Use [jspecify](https://jspecify.dev) nullability annotations.
Generate changelog in
|
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the codebase from using the abandoned jsr305 annotations to the actively maintained jspecify nullability annotations.
- Replaces javax.annotation.Nullable/Nonnull with org.jspecify.annotations.Nullable/NonNull.
- Adds @NullMarked to package-info files to enforce a default nullability context.
Reviewed Changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracing/src/main/java/com/palantir/tracing/Tracer.java | Updated import for nullability annotation. |
| tracing/src/main/java/com/palantir/tracing/TraceState.java | Updated import for nullability annotation. |
| tracing/src/main/java/com/palantir/tracing/TraceLocal.java | Changed method parameter annotations from @nonnull to @nonnull and updated @nullable annotations. |
| tracing/src/main/java/com/palantir/tracing/Trace.java | Updated import for nullability annotation. |
| tracing/src/main/java/com/palantir/tracing/DetachedSpan.java | Adjusted error prone annotation import while migrating nullability annotations. |
| tracing/src/main/java/com/palantir/tracing/Detached.java | Adjusted error prone annotation import while migrating nullability annotations. |
| tracing/src/main/java/com/palantir/tracing/DeferredTracer.java | Updated import for nullability annotation. |
| tracing-undertow, tracing-servlet, tracing-servlet-jakarta, tracing-okhttp3, tracing-jersey, tracing-jersey-jakarta, tracing-jaxrs, tracing-jaxrs-jakarta, tracing-benchmarks, tracing-api | Added package-level @NullMarked and updated license header files. |
Files not reviewed (2)
- tracing-undertow/build.gradle: Language not supported
- tracing/build.gradle: Language not supported
Use [jspecify](https://jspecify.dev) nullability annotations.
mpritham
approved these changes
May 12, 2025
Contributor
Author
|
👍 |
|
Released 6.23.0 |
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.
Before this PR
jsr305 is abandoned
See similar palantir/tritium#2133
After this PR
==COMMIT_MSG==
Use jspecify nullability annotations.
==COMMIT_MSG==
Possible downsides?