Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

An external spec cannot refine methods its class inherits

Open
#379 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
67
Forks
36
Avg merge
2d 4h
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from liquid-java/liquidjava

All issues in liquid-java/liquidjava

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.