An external spec cannot use its superclass spec's states unless the superclass spec is read first
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 64/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Java
- Estrelas
- 73
- Forks
- 38
- Merge médio
- 12h 32min
- PRs com merge (30d)
- 45
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de liquid-java/liquidjava
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
liquid-java/liquidjava#562 ·
Mantenedores costumam responder em até 1 dia
-
A float ghost crashes the verifier: "Ghost not implemented for type float"Talvez já em andamento @MohammedZaid1740 assumiu há 7 dias. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 1 dia
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatibleTalvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
liquid-java/liquidjava#558 ·
Mantenedores costumam responder em até 1 dia
-
new T[a][b] gets length b instead of a (unsound)Talvez já em andamento @CatarinaGamboa assumiu há 4 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 30/100
liquid-java/liquidjava#557 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 60/100
quelea-projection/Quelea#749 ·
Mantenedores costumam responder em até 1 dia
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
erkamyaman/rust-anything#963 ·
Mantenedores costumam responder em até 1 dia
-
api-diagnostics bug jdbc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
ClickHouse/clickhouse-java#3464 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 76/100
-
Deferred
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Sanne/incus-spawn#2768 ·
Mantenedores costumam responder em até 1 dia