[Maintenance]: Change nullability annotations

Aperta
#6,129 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
build-system

Direzione di ricerca

Find the project's dependency declarations and Java sources using javax.annotation.Nullable or javax.annotation.Nonnull. Start by checking how dependencies are managed and searching for those annotation uses. Add JSpecify, replace the annotations, and remove jsr305; done when the project builds with all usages migrated and the old dependency removed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

code-maintenance
Describe the problem

So far, we have been using javax.annotation.Nullable and javax.annotation.Nonnull whereever we using nullability annotations. These are great for things like return and parameter types, but have limited uses elsewhere.

Also, despite living under javax, these are not standard annotations as JSR-305 was never accepted. The annotations are instead provided by com.google.code.findbugs:jsr305:3.0.2, which is not being kept up-to-date with language changes (no update since 2017).

The improvement you'd like to see
  • Add a dependency on org.jspecify:jspecify.
  • Replace uses of javax.annotations.Nullable with org.jspecify.annotations.Nullable
  • Replace uses of javax.annotations.Nonnull with org.jspecify.annotations.NonNull
  • Remove the dependency on com.google.code.findbugs:jsr305
Expected Benefits

We'll have nullability annotations that can be used in most contexts (e.g., generics) from a library that is maintained and can react to language changes (even though releases are rarely needed).

Additional Context

No response

Lingua principale
Java
Stelle
927
Fork
286
Merge medio
3g 17h
PR unite (30g)
94

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RPTools/maptool

Tutte le issue di RPTools/maptool

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.