Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#449 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
71
Fork
37
Merge medio
1g 19h
PR unite (30g)
57

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di liquid-java/liquidjava

Tutte le issue di liquid-java/liquidjava

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.