IsolateClass: a group isolate doesn't compile: interfaces become classes, annotation stubs lack @Target
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
Línea de trabajo
Start with util/IsolateClass.java, especially phase 0 around line 324, and reproduce using the fernflower steps in the issue: isolate DomHelper with the types from reachedPerType(), then print and parse the result with failFast(true). Check the emitted nature of isolated interfaces and how annotation stubs preserve @Target; the issue also lists four remaining compile errors that are not yet analyzed. Done means the isolated tree compiles in the described reproduction.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
IsolateClass.isolate(List<TypeInfo>) (maddi-mod, maddi-modification-common, util/IsolateClass.java) produces trees that don't compile once the group holds an interface or the code uses type-use annotations. Found isolating fernflower's DomHelper together with the 33 fernflower types it reaches.
1. An isolated interface is emitted as a class
Phase 0 builds every isolated type with .setTypeNature(runtime.typeNatureClass()) (line 324), and nothing later restores the original's nature. With org.jetbrains.java.decompiler.struct.match.IMatchable in the group:
public abstract class IMatchable { // the original is an interface
so every implements IMatchable fails ("interface expected here"; 4 of 55 errors, plus their follow-ups). The single-type isolate doesn't hit this when the isolated type is a class, and as a stub an interface comes out right. Only an interface that is itself isolated is affected. Enums, records and annotation types are probably affected the same way (not checked).
2. Annotation stubs are not usable in type-use positions
org.jetbrains.annotations.Nullable and NotNull are stubbed without @Target, so a verbatim body using them in a type position (@Nullable String[], a type argument) fails with "annotation @org.jetbrains.annotations.Nullable not applicable in this type context" (8 of the remaining 12 errors). A stub annotation needs its original's @Target, or failing that one that includes TYPE_USE.
3. Remaining
With interfaces kept out of the group and the two annotation stubs replaced by hand, four errors remain, not yet analyzed:
StructClass is not abstract and does not override abstract method getType()in a stubbed supertype;constructor DataInputStream in class java.io.DataInputStream cannot be applied to given types;- two more.
The parse then drops StructClass and DataInputFullStream.
Reproduce
Parse fernflower (JavaToKotlinRatchet.parse("fernflower")), isolate DomHelper alone, take the corpus types in reachedPerType(), isolate [DomHelper] + those, print with the members' verbatim sources and parse the tree back with failFast(true).
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 h 44 min
- PR fusionados (30 d)
- 6
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 · 3 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 5/5 Más de una semana Aptitud para principiantes 14/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
front-end:rust
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
Todos los issues de CodeLaser/maddi
Issues similares
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 70/100
Vakore/ZappierGames#248 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
thelastpickle/cassandra-reaper#1748 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
A proxy that fails to start logs a RejectedExecutionException stack trace from its shutdown hookAbiertofollow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Sanne/incus-spawn#1953 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
OneBusAway/maglev#1917 · 1 comentario ·
Los mantenedores suelen responder en 3 días