Skip to content

Migrate null annotations to jspecify #1066

Open

Description

@michaelboyles

Currently, the sdk uses Reactor's reactor.util.annotation.Nullable annotations, such as here

public static void notEmpty(@Nullable Collection<?> collection, String message) {

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.

Activity

  1. added
    enhancementNew feature or request
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Aug 17, 2026
  2. added
    ready for workThe goal is clear and work towards it can be commenced
    on Aug 17, 2026
  3. steven-ji commented on Aug 22, 2026

    @steven-ji

    I would like to work on this issue.

    I verified that the current main branch still has six mcp-core imports of Reactor's deprecated Nullable annotation and that there is no active implementation PR.

    I will keep the change focused on replacing those existing imports with JSpecify and adding only the direct dependency needed by mcp-core. I will not introduce package-wide @NullMarked semantics or unrelated nullness refactoring. I will validate the dependency graph, compilation, formatting, and the full mcp-core test suite.

    If you have already started an implementation, please let me know so I can avoid duplicate work.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureenhancementNew feature or requestready for workThe goal is clear and work towards it can be commenced

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions