modelcontextprotocol / modelcontextprotocol/java-sdk
Migrate null annotations to jspecify
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 9
Description
Currently, the sdk uses Reactor's reactor.util.annotation.Nullable annotations, such as here
This is causing warnings in my downstream build since that type refers to javax classes I don't have on the classpath.
This is Reactor Nullable, along with its imports:
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierNickname;
import javax.annotation.meta.When;
@Nonnull(when = When.MAYBE)
@TypeQualifierNickname
@Deprecated
public @interface Nullable {
}
The Reactor type is now deprecated, and they recommend you using JSpecify which is fast becoming the standard, if it is not already.
I can possibly submit a PR for this, but I notice a lot of PRs opened recently have limited activity, so will wait for the go-ahead first.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with mcp-core/src/main/java/io/modelcontextprotocol/util/Assert.java and search the repository for reactor.util.annotation.Nullable and related Reactor null annotations. Check the build configuration for the JSpecify dependency, then verify that all relevant annotations use JSpecify and that the SDK builds without requiring the javax annotation classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100