IsolateClass: a group isolate doesn't compile: interfaces become classes, annotation stubs lack @Target
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 1
- Merge medio
- 1h 44m
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodeLaser/maddi
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CodeLaser/maddi#166 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
build/ci good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 14/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
front-end:rust
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CodeLaser/maddi
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
liberation-data/drivine4j#547 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts itForse già presa @AkashB23 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
spring-cloud/spring-cloud-stream#3321 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致Forse già presa @fishdry1000 l’ha presa 4 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
ai-driven-fuzzing bug claude Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
linagora/twake-calendar-side-service#1333 ·
I maintainer di solito rispondono entro 1 giorno