JetBrains / JetBrains/java-annotations

Deprecate and hide @Nullable, @NonNull annotations to avoid name clashes with jspecify

Abierto
#134 6 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Kotlin
Estrellas
463
Forks
72
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Currently, `org.jetbrains.kotlin:kotlin-stdlib:2.2.21` depends on `org.jetbrains:annotations`, so it brings `org.jetbrains.annotations.Nullable` to IDE autocomplete.

The ecosystem moves towards https://jspecify.dev/, so it would be nice if you could deprecate and hide `@Nullable` and `@NonNull` annotations.

Deprecation is straightforward: `@Deprecated` + release announcement.
Hiding would probably involve adding `ACC_SYNTHETIC` modifier after the compilation. It would still keep the class in the bytecode, so the old libraries would still work fine in the runtime, while the new clients would need to move to a different nullability annotations.
An alternative option could be to rewrite `@Nullable` annotation in Kotlin and use `@Deprecated(level = HIDDEN)`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.