External specs: a @StateSet declared later in the file is not found by an interface earlier in it
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- compilers, testing-qa
Direzione di ricerca
Start with the verifier code that resolves @StateSet declarations and the V32_StateSetDeclaredLater probe in liquid-java/co-specification. Trace why a state declared in a later external refinement interface is unavailable to an earlier interface, then run the probe before and after the change. Done means the reproducer verifies successfully regardless of declaration order.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When one spec file holds external refinements for several classes of a hierarchy, the interface that declares the @StateSet has to come first in the file. If an interface earlier in the file uses the states, verification fails with Not Found Error: Ghost '...' could not be found, even though the declaration is in the same file. Declaration order should not matter.
Minimal reproducer
FrameRefinements.java:
import liquidjava.specification.ExternalRefinementsFor;
import liquidjava.specification.StateRefinement;
import liquidjava.specification.StateSet;
@ExternalRefinementsFor("java.awt.Frame")
public interface FrameRefinements {
@StateRefinement(to = "notDisplayable(this)")
void Frame();
@StateRefinement(from = "notDisplayable(this)")
void setUndecorated(boolean undecorated);
}
@ExternalRefinementsFor("java.awt.Window")
@StateSet({"notDisplayable", "displayable"}) // declared here, after its first use above
interface WindowRefinements {
@StateRefinement(to = "displayable(this)")
void pack();
}
Client.java (correct code):
import java.awt.Frame;
public class Client {
public static void main(String[] args) {
Frame f = new Frame();
f.setUndecorated(true);
f.pack();
}
}
Found:
Not Found Error: Ghost 'java.awt.Frame.notDisplayable' could not be found
@StateRefinement(to = "notDisplayable(this)")
Expected: Correct! Passed Verification., as when the WindowRefinements interface is moved above FrameRefinements (nothing else changed).
Real-world scenario
Frame.setUndecorated throws IllegalComponentStateException: The frame is displayable. once the frame has a peer, and pack()/setVisible(true) (declared in java.awt.Window) create it. A spec for this, used to catch real bugs like calling setUndecorated(true) after pack() in a game window, needs interfaces for Window, Frame, Component and JFrame. The state must be declared on Window, since a state declared on Frame cannot be used by Window.pack() (expected Frame, got Window, which seems right). The natural order, with the class being specified first, then fails as above.
Verifier commit 1a506fe. Reproducer as a verifier probe: liquid-java/co-specification verifier-probes/V32_StateSetDeclaredLater.
- Lingua principale
- Java
- Stelle
- 71
- Fork
- 37
- Merge medio
- 1g 19h
- PR unite (30g)
- 46
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 liquid-java/liquidjava
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
liquid-java/liquidjava#443 ·
I maintainer di solito rispondono entro 2 giorni
-
bug real-world-finding
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
liquid-java/liquidjava#395 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
liquid-java/liquidjava#373 ·
I maintainer di solito rispondono entro 2 giorni
-
bug error messages
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
liquid-java/liquidjava#471 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 69/100
liquid-java/liquidjava#470 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di liquid-java/liquidjava
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
objectionary/lints#1640 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openhab/openhab-addons#22168 ·
I maintainer di solito rispondono entro 1 giorno