An external spec cannot use its superclass spec's states unless the superclass spec is read first
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 64/100
Piste de recherche
Start by reproducing the failure with the three-file example, then read ExternalRefinementTypeChecker.visitCtInterface and compare its behavior with RefinementProcessor.processPackage. Check how processing sub-packages affects registration order too. Done means external specs' state sets are registered before methods are read, independent of file and package order, with the reproducer no longer reporting a missing ghost state.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Impact: a subclass's external spec can use the states of a @StateSet declared in its superclass's spec only if the verifier reads the superclass's spec first. Spec files are read in package order (file names here), so splitting a JDK hierarchy into one file per class breaks depending on the names. FrameRefinements.java sorts before WindowRefinements.java, so this fails.
Minimal reproducer (three files in one directory)
// FrameRefinements.java
@ExternalRefinementsFor("java.awt.Frame")
public interface FrameRefinements {
@StateRefinement(to = "notDisplayable(this)")
void Frame(String title);
@StateRefinement(from = "notDisplayable(this)")
void setUndecorated(boolean undecorated);
}
// WindowRefinements.java
@StateSet({"displayable", "notDisplayable"})
@ExternalRefinementsFor("java.awt.Window")
public interface WindowRefinements {
@StateRefinement(to = "notDisplayable(this)")
void dispose();
@StateRefinement(to = "displayable(this)")
void pack();
}
// Use.java
public class Use {
static void borderless() {
Frame host = new Frame("Playfield");
host.pack();
host.setUndecorated(true);
}
}
Actual (main @ 19991d36):
Not Found Error: Ghost 'java.awt.Frame.notDisplayable' could not be found
6 | @StateRefinement(to = "notDisplayable(this)")
| ^^^^^^^^^^^^^^^^^^^^
FrameRefinements.java:6
If the two interfaces are in one file with Window first, or if WindowRefinements.java is renamed so that it sorts first (e.g. AWindowRefinements.java), the program verifies up to the expected State Refinement Error on host.setUndecorated(true).
Expected: the result does not depend on file order. The state sets of every external spec should be registered before any spec's methods are read. RefinementProcessor.processPackage already does this for the methods of user classes, but ExternalRefinementTypeChecker.visitCtInterface reads an interface's @StateSets and its methods together, one interface at a time. Sub-packages are processed after their parent, so the same problem appears when the two specs are in different packages.
Found while working on #456.
- Langage dominant
- Java
- Étoiles
- 73
- Forks
- 38
- Merge moyen
- 12 h 32 min
- PR mergées (30 j)
- 45
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de liquid-java/liquidjava
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
liquid-java/liquidjava#562 ·
Les mainteneurs répondent en général sous 1 jour
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Peut-être pris @MohammedZaid1740 l’a pris il y a 7 jours. Ouvertebug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
liquid-java/liquidjava#443 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug real-world-finding
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
liquid-java/liquidjava#395 ·
Les mainteneurs répondent en général sous 1 jour
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatiblePeut-être pris @CatarinaGamboa l’a pris il y a 4 jours. Ouvertebug
Difficulté 4/5 3-5 jours Accessibilité débutants 15/100
liquid-java/liquidjava#558 ·
Les mainteneurs répondent en général sous 1 jour
-
new T[a][b] gets length b instead of a (unsound)Peut-être pris @CatarinaGamboa l’a pris il y a 4 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 30/100
liquid-java/liquidjava#557 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de liquid-java/liquidjava
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 60/100
quelea-projection/Quelea#749 ·
Les mainteneurs répondent en général sous 1 jour
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 92/100
erkamyaman/rust-anything#963 ·
Les mainteneurs répondent en général sous 1 jour
-
api-diagnostics bug jdbc
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
ClickHouse/clickhouse-java#3464 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Une demi-journée Accessibilité débutants 76/100
-
Deferred
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Sanne/incus-spawn#2768 ·
Les mainteneurs répondent en général sous 1 jour