Java printer: a nested type prints by simple name when the unit imports another type of that name
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Start at the Java printer and the importComputer call shown in the issue, then trace how it decides whether a nested type can print by its simple name. Reproduce the case with the two Builder types and confirm the printed source resolves to the wrong one. Done when the nested type remains unambiguous in printed output and the example can be reparsed successfully.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A nested type of an imported type, written Outer.Impl.Builder, prints by its simple name Builder when the unit also imports another type named Builder. The printed unit then means the imported type.
package a.c;
public class Builder { }
package a.d;
public class Outer {
public static class Impl {
public static class Builder { public Builder set(int i) { return this; } }
}
}
package a.b;
import a.c.Builder;
import a.d.Outer;
public class X {
Builder own;
Object make() {
return new Outer.Impl.Builder().set(0);
}
}
javaInspector.print2(cu, null, javaInspector.importComputer(4, cu.sourceSet())) prints
public class X { Builder own; Object make() { return new Builder().set(0); } }
so new Builder() is a.c.Builder, which has no set. It looks as if the printer takes the simple name as visible because some type of that simple name is imported, without checking it is the same type. (#114 was the converse: a nested type qualified by an outer name the unit had taken.)
Found re-parsing printed sources of jenkins core: hudson.model.Build, Project, hudson.Functions and jenkins.model.Jenkins import hudson.tasks.Builder and use another nested Builder; all four units are dropped (the re-parse then fails with "Unexpected javac type in convert: 'recovery'"). Jenkins alone held 8 of the idiom sites lost in that run.
maddi 0.9.6-alpha.4.
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 h 55 min
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodeLaser/maddi
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CodeLaser/maddi#166 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
build/ci good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de CodeLaser/maddi
Issues similares
-
pending:code-area pending:issue-category to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area:core bug priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aomarai/minecraft-mcp#247 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
antonyrag/ragleap-core#1062 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
projectnessie/nessie#13256 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Vakore/ZappierGames#232 ·