False error: @StateRefinement(from = "false") gives "State Conflict Error: Found multiple disjoint states"
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- java
Direção de pesquisa
Start by reading the state transition validation path that reports “Found multiple disjoint states” and trace how it handles @StateRefinement(from = "false") in the reproducer. Check the existing tests for state refinements and add a case where the method is never called. Done means the spec verifies successfully while a call to unsupported() is rejected.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Impact: there is no direct way to say "this call is never allowed". from = "false" should refuse the method in every state. Instead it makes the spec itself an error, even in programs that never call the method.
Minimal reproducer
import liquidjava.specification.StateRefinement;
import liquidjava.specification.StateSet;
@StateSet({"a", "b"})
class Res {
@StateRefinement(to = "a(this)")
public Res() {}
@StateRefinement(from = "false")
public void unsupported() {}
public void fine() {}
}
public class Repro {
public static void main(String[] args) {
Res r = new Res();
r.fine(); // unsupported() is never called
}
}
Expected: Correct! Passed Verification. A call to unsupported() would then be refused.
Actual (main @ f7f366c, and 1a506fe):
State Conflict Error: Found multiple disjoint states in state transition: state transition can only go to one state of each state set
12 | @StateRefinement(from = "false")
Real-world scenario. javax.management.modelmbean.RequiredModelMBean.load() and store() always throw MBeanException("Persistence not supported for this MBean") (RequiredModelMBean.java:372-378, 414-420), so a spec should refuse them everywhere. Barista's expert spec allows them, so the bug goes unreported.
Workaround: an int ghost that no call sets, with the constructor setting it to 0 (from = "supported(this) == 1"). It works, but it's an odd thing to have to write.
- Linguagem predominante
- Java
- Estrelas
- 71
- Forks
- 37
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 57
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 2/5 1-3 horas Facilidade para iniciantes 72/100
liquid-java/liquidjava#443 ·
Mantenedores costumam responder em até 2 dias
-
bug real-world-finding
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
liquid-java/liquidjava#395 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
liquid-java/liquidjava#373 ·
Mantenedores costumam responder em até 2 dias
-
External specs: a @StateSet declared later in the file is not found by an interface earlier in itAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 58/100
liquid-java/liquidjava#452 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
liquid-java/liquidjava#451 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de liquid-java/liquidjava
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
breaking change bug needs human review not ready priority medium size S
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
martin-francois/symphony-trello#1193 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Mend: dependency security vulnerability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100