Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

States named across specs resolve only if the declaring spec was registered first

未关闭
#378 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java

调研方向

Start by tracing how spec types are registered and how @StateSet names are resolved for @StateRefinement references; the issue does not identify specific files or tests. Reproduce with the JFrame, Frame, and AWindow specs in the reported order, then move AWindowSpec before the others to compare results. Done means verification no longer depends on spec declaration order.

由索引模型根据 Issue 内容生成。

描述

bug

A spec may name a state declared in another class's spec (by simple name, through the hierarchy). This only works if the spec with the @StateSet is registered first, which follows textual order.

@ExternalRefinementsFor("javax.swing.JFrame")
public interface JFrameSpec {
    @StateRefinement(to = "notDisplayable(this)")
    void JFrame(String title);
}
@ExternalRefinementsFor("java.awt.Frame")
interface FrameSpec {
    @StateRefinement(from = "notDisplayable(this)")
    void setUndecorated(boolean undecorated);
}
@StateSet({"notDisplayable", "displayable"})
@ExternalRefinementsFor("java.awt.Window")
interface AWindowSpec {
    @StateRefinement(to = "displayable(this)") void pack();
    @StateRefinement(to = "notDisplayable(this)") void dispose();
}

On main 321a7321, with a client that builds a JFrame: Not Found Error: Ghost 'javax.swing.JFrame.notDisplayable' could not be found. With AWindowSpec moved first in the file: Correct! Passed Verification.
We should get this in the first pass.

Expected: the result does not depend on the order of the spec types (e.g. register all @StateSets before resolving state names in refinements).

主要语言
Java
星标
67
派生
36
平均合并
2 天 3 小时
30 天内合并 PR
29

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liquid-java/liquidjava 的其他 Issue

查看 liquid-java/liquidjava 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。