Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

False error: @StateRefinement(from = "false") gives "State Conflict Error: Found multiple disjoint states"

Aberta
#449 0 comentários 0 reações 0 responsáveis Ver no GitHub

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

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de liquid-java/liquidjava

Todas as issues de liquid-java/liquidjava

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.