modelcontextprotocol / modelcontextprotocol/java-sdk

Migrate null annotations to jspecify

Offen
#1,066 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement P2 ready for work
Vorherrschende Sprache
Java
Sterne
3.7k
Forks
1.1k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit mcp-core/src/main/java/io/modelcontextprotocol/util/Assert.java und durchsuche das Repository nach reactor.util.annotation.Nullable und verwandten Reactor-Null-Annotationen. Überprüfe die Build-Konfiguration auf die JSpecify-Abhängigkeit und verifiziere anschließend, dass alle relevanten Annotationen JSpecify verwenden und das SDK erstellt werden kann, ohne die javax-Annotation-Klassen zu benötigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api, backend
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.