Import computer: a type used only as a constructor call's type argument (var x = new Box<Sol>()) is not imported
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
- 67/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- developer-experience, tooling
Línea de trabajo
Start by locating javaInspector.importComputer and the code that collects types used by constructor calls; the issue reproduces the omission with new Box<Sol>(4) when assigned to var. Run the reproduction through javaInspector.print2 and check that the output includes import a.c.Sol; and compiles with javac. The issue names no test file, so first look for existing import computer tests and add the case there.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A type that a unit uses only as a type argument of a constructor call, as in var x = new Box<Sol>(4), loses its import: the import computer does not collect it.
package a.c;
public class Sol { }
package a.b;
public class Box<S> { public Box(int i) { } }
package a.b;
import a.c.Sol;
public class V {
Object m() {
var box = new Box<Sol>(4);
return box;
}
}
javaInspector.print2(cu, null, javaInspector.importComputer(4, cu.sourceSet())) prints
package a.b;
public class V { Object m() { var box = new Box<Sol>(4); return box; } }
without import a.c.Sol;, and javac rejects it. With var, the constructor call's type arguments are the only place the type is written, so nothing else brings the import in.
Found re-parsing printed sources of timefold-solver, where this is a common style: var termination = new MoveCountTermination<TestdataSolution>(4), var map = new HashMap<Class<?>, Set<Object>>(), new LinkedHashMap<Class<?>, List<AbstractRootNode<?>>>(), ... 10 units are dropped for it in one run (TestdataSolution, Set, List, ConstraintMetaModel, MoveSelector, TestdataListSolution).
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 68/100
Los mantenedores suelen responder en 1 día
-
Java printer: a nested type prints by simple name when the unit imports another type of that nameAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
Todos los issues de CodeLaser/maddi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/context-ontology-accelerator#325 ·
Los mantenedores suelen responder en 1 día
-
The README tells to run `mvn jeo:disassemble`, which fails with `No plugin found for prefix 'jeo'`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
objectionary/jeo-maven-plugin#1938 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oVirt/ovirt-engine#1219 ·
Los mantenedores suelen responder en 1 día
-
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