[Maintenance]: Change nullability annotations

Abierto
#6,129 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java
Área
build-system

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
927
Forks
286
Merge medio
3 d 17 h
PR fusionados (30 d)
94

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RPTools/maptool

Todos los issues de RPTools/maptool

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.