Skip to content

Migrate from jsr305 to jspecify nullability annotations#1398

Merged
bulldozer-bot[bot] merged 4 commits intodevelopfrom
davids/jspecify
May 13, 2025
Merged

Migrate from jsr305 to jspecify nullability annotations#1398
bulldozer-bot[bot] merged 4 commits intodevelopfrom
davids/jspecify

Conversation

@schlosna
Copy link
Contributor

Before this PR

jsr305 is abandoned

See similar palantir/tritium#2133

After this PR

==COMMIT_MSG==
Use jspecify nullability annotations.
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Mar 28, 2025

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Use jspecify nullability annotations.

Check the box to generate changelog(s)

  • Generate changelog entry

@schlosna schlosna requested a review from Copilot March 28, 2025 18:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@schlosna schlosna requested review from a team and bmarcaur and removed request for a team March 28, 2025 18:33
@schlosna
Copy link
Contributor Author

👍

@bulldozer-bot bulldozer-bot bot merged commit f13b089 into develop May 13, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the davids/jspecify branch May 13, 2025 00:39
@autorelease3
Copy link

autorelease3 bot commented May 13, 2025

Released 6.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants