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

maddi-java-openjdk: type-use annotations on an anonymous class creation's type are dropped

Abierto
#144 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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 by tracing how the OpenJDK front end builds the anonymous class’s parent ParameterizedType and the ConstructorCall type, then compare that path with the named class supertype clause that preserves annotations. The issue names no files or tests, so first locate those entry points and a focused front end test. Done when the anonymous class parent type retains @Nullable and the Kotlin output keeps the annotation consistently with the next() return type.

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

Descripción

bug front-end:javac

The OpenJDK front end keeps no type-use annotations on the type of an anonymous class creation. guava's Iterators.partitionImpl:

return new UnmodifiableIterator<List<@Nullable T>>() {
  @Override
  public List<@Nullable T> next() { ... }
};

arrives as UnmodifiableIterator<List<T>>. Neither the anonymous class's parent type nor the ConstructorCall's type carries the @Nullable. The same annotation on a named class's supertype clause is kept; the J2K printer prints that one as T? since 367ca79bc.

Effect: the Kotlin translation prints the anonymous class header as UnmodifiableIterator<MutableList<T>>, while its next(): MutableList<T?> keeps the annotation. kotlinc then reports "return type of 'fun next(): MutableList<T?>' is not a subtype of the return type of the overridden member" (guava Iterators.kt:387, Iterables.kt:177, and Iterators.kt:376/397 downstream).

Expected: the parent ParameterizedType of the anonymous TypeInfo, or the ConstructorCall's parameterizedType(), carries the type-use annotations as written, as for a named class's extends/implements clause.

Found while reducing guava's KotlinConf scoreboard compile errors, together with the printer session.

🤖 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.