Migrate the existing mcp-core nullable annotations from Reactor's deprecated
reactor.util.annotation.Nullable to org.jspecify.annotations.Nullable.
The change adds JSpecify as a direct compile dependency of mcp-core, replaces the
five annotations that are actively used, and removes one unused Reactor Nullable
import. It does not introduce package-wide @NullMarked semantics or unrelated
nullness changes.
Motivation and Context
Reactor's Nullable annotation is deprecated and references legacy
javax.annotation.meta types. Downstream compilation can therefore report missing
annotation classes even though the SDK itself does not otherwise require them.
JSpecify provides the intended type-use nullness metadata without the legacy
javax.annotation dependency. Version 1.0.0 is also the version already present in
the repository's resolved test dependency graph.
flattened POM contains JSpecify 1.0.0 with compile scope
OSGi imports org.jspecify.annotations with range [1.0,2)
OSGi no longer imports reactor.util.annotation
Inspected the packaged bytecode for all five annotated public types; each references
org/jspecify/annotations/Nullable
git diff --check origin/main...HEAD
Full reactor validation also passed locally:
env npm_config_cache=/private/tmp/java-sdk-1066-npm-cache ./mvnw clean test "-DsurefireArgLine=-Duser.language=en -Duser.country=US"
all 11 reactor modules succeeded
958 tests passed
0 failures, 0 errors, 0 skipped
Breaking Changes
No Java method signature or binary behavior changes. The public nullness annotation
metadata intentionally changes from Reactor Nullable to JSpecify Nullable.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
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
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.
Migrate the existing mcp-core nullable annotations from Reactor's deprecated
reactor.util.annotation.Nullable to org.jspecify.annotations.Nullable.
The change adds JSpecify as a direct compile dependency of mcp-core, replaces the
five annotations that are actively used, and removes one unused Reactor Nullable
import. It does not introduce package-wide @NullMarked semantics or unrelated
nullness changes.
Motivation and Context
Reactor's Nullable annotation is deprecated and references legacy
javax.annotation.meta types. Downstream compilation can therefore report missing
annotation classes even though the SDK itself does not otherwise require them.
JSpecify provides the intended type-use nullness metadata without the legacy
javax.annotation dependency. Version 1.0.0 is also the version already present in
the repository's resolved test dependency graph.
Fixes #1066
How Has This Been Tested?
Before the change, compiling mcp-core reproduced the warning:
After the migration:
org/jspecify/annotations/Nullable
Full reactor validation also passed locally:
Breaking Changes
No Java method signature or binary behavior changes. The public nullness annotation
metadata intentionally changes from Reactor Nullable to JSpecify Nullable.
Types of changes
Checklist
Additional context
annotation type referenced by the SDK's public bytecode.