Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Class-file CLASS-retention annotations (RuntimeInvisibleAnnotations) are not read: SpotBugs @CheckForNull/@NonNull on library members

Abierto
#161 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
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, kotlin

Línea de trabajo

Start with ClassSymbolScanner.loadAnnotations and inspect how it reads library member annotations through javac symbols. Compare that result with the class file's RuntimeInvisibleAnnotations for the JnlpConnectionState.getStash example; the issue suggests the JDK ClassFile API or maddi-java-bytecode as entry points. Done means CLASS-retention annotations such as @CheckForNull and @NonNull are included in the nullability analysis.

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

Descripción

ClassSymbolScanner.loadAnnotations reads a library member's annotations through javac's symbols (symbol.getAnnotationMirrors()). Annotations with CLASS retention are stored in a class file's RuntimeInvisibleAnnotations attribute and do not show up there. kotlinc reads them, so Kotlin sees a nullness that maddi's analysis does not.

Example: jenkins remoting's JnlpConnectionState.getStash(Class<S>) carries edu.umd.cs.findbugs.annotations.CheckForNull (RuntimeInvisibleAnnotations, checked with javap).

  • kotlinc infers val state = event.getStash(State::class.java) as State?.
  • The nullability pass never seeds it: no cause in the jenkins causes run mentions a stapler or remoting annotation, although both use @CheckForNull and @NonNull widely.

Effect on the jenkins J2K trial (2026-10-20): DefaultJnlpSlaveReceiver.kt ×6, likely also Channels.kt:50/76 and JnlpSlaveAgentProtocol4.kt:76.

Type-use annotations in RuntimeVisibleTypeAnnotations (JSpecify) are a separate path, now carried by 21b739d11 on ws/maddi-null.

Possible fix: read RuntimeInvisibleAnnotations of a library member from the class file itself, through the JDK ClassFile API or maddi-java-bytecode, and add those annotations next to the visible ones.

🤖 Generated with Claude Code

Lenguaje dominante
Java
Estrellas
1
Forks
1
Merge medio
1 h 58 min
PR fusionados (30 d)
5

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 CodeLaser/maddi

Todos los issues de CodeLaser/maddi

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.