modelcontextprotocol / modelcontextprotocol/java-sdk

Migrate null annotations to jspecify

オープン
#1,066 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement P2 ready for work
主要言語
Java
スター
3.7k
フォーク
1.1k
平均マージ
1日 15時間
マージ済み PR(30日)
9

説明

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

https://github.com/modelcontextprotocol/java-sdk/blob/fd004989b9484c9b81be6b03463396797b354804/mcp-core/src/main/java/io/modelcontextprotocol/util/Assert.java#L28

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

mcp-core/src/main/java/io/modelcontextprotocol/util/Assert.java から始め、リポジトリ内で reactor.util.annotation.Nullable と関連する Reactor の null アノテーションを検索します。ビルド設定で JSpecify 依存関係を確認し、その後、関連するすべてのアノテーションが JSpecify を使用していること、また javax アノテーションクラスを必要とせずに SDK をビルドできることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, backend
issue の種類
リファクタリング
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。