Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

An external spec cannot refine methods its class inherits

オープン
#379 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@CatarinaGamboa がすでに取り組んでいます。

2026年10月8日 から。

  • #387 @CatarinaGamboa による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java

調査の方向性

Start by reading the external-refinement method lookup that emits “Could not find method” for pack() and setUndecorated(boolean); the issue does not name its source files or tests. Reproduce the example against the reported main revision, then trace how lookup handles methods inherited from java.awt.Window and java.awt.Frame. Done when an external spec can name those inherited methods and the protocol example is verified as intended.

索引モデルが issue の本文から書いたものです。

説明

bug
@StateSet({"displayable", "notDisplayable"})
@ExternalRefinementsFor("javax.swing.JFrame")
public interface JFrameRefinementsExpert {
    @StateRefinement(to = "notDisplayable(this)") void JFrame(String title);
    @StateRefinement(to = "displayable(this)") void pack();
    @StateRefinement(from = "notDisplayable(this)") void setUndecorated(boolean undecorated);
}

public class Repro {
    void show() {
        JFrame f = new JFrame("x");
        f.pack();
        f.setUndecorated(true);   // throws IllegalComponentStateException: The frame is displayable.
    }
}

On main 321a7321:

Warning: Could not find method 'void pack()' for 'javax.swing.JFrame'
Warning: Could not find method 'void setUndecorated(boolean)' for 'javax.swing.JFrame'
Correct! Passed Verification.

pack is declared in java.awt.Window and setUndecorated in java.awt.Frame; a spec can only name methods its own class declares. A protocol that spans a hierarchy (here: displayable, from Window, guarding a Frame method) then has to be split into one interface per declaring class, sharing states by simple name (which also depends on registration order, see the related issue). Expected: an external spec can name inherited methods, applying to calls on receivers of that class.

主要言語
Java
スター
67
フォーク
36
平均マージ
2日 3時間
マージ済み PR(30日)
29

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

liquid-java/liquidjava のほかの issue

liquid-java/liquidjava の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。