False error: @StateRefinement(from = "false") gives "State Conflict Error: Found multiple disjoint states"
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 71
- 派生
- 37
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 46
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liquid-java/liquidjava 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
liquid-java/liquidjava#443 ·
维护者通常 2 天内回复
-
bug real-world-finding
难度 2/5 1-3 小时 新手友好度 82/100
liquid-java/liquidjava#395 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
liquid-java/liquidjava#373 ·
维护者通常 2 天内回复
-
bug error messages
难度 4/5 3-5 天 新手友好度 52/100
liquid-java/liquidjava#471 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 69/100
liquid-java/liquidjava#470 ·
维护者通常 2 天内回复
查看 liquid-java/liquidjava 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
objectionary/lints#1640 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 半天 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
openhab/openhab-addons#22168 ·
维护者通常 1 天内回复