Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

False error in external specs: a @Ghost the constructor does not set gives "Ghost 'old' could not be found" at the next from-only call

Offen
#450 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java
Bereich
testing

Rechercherichtung

Start with the external refinement spec and client in the minimal reproducer, then trace how the external @Ghost declaration is handled when checking the constructor and the following canUndo() call. Compare that path with the in-source example described in the issue. Done means the reproducer reports “Correct! Passed Verification.” while preserving the reported behavior for the other examples.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Impact: adding a @Ghost to an external spec breaks correct programs, unless every constructor sets the ghost. The error names a ghost called old, which is internal and not in the spec.

Minimal reproducer (an external spec and a client, in one directory)

// EditRefinements.java
@ExternalRefinementsFor("javax.swing.undo.AbstractUndoableEdit")
@StateSet({"done", "undone"})
@Ghost("int supported")
public interface EditRefinements {
    @StateRefinement(to = "done(this)")
    void AbstractUndoableEdit();

    @StateRefinement(from = "done(this)")
    boolean canUndo();
}

// Client.java
public class Client {
    public static void main(String[] args) {
        AbstractUndoableEdit e = new AbstractUndoableEdit();
        e.canUndo();
    }
}

Expected: Correct! Passed Verification.

Actual (main @ f7f366c, and 1a506fe):

Not Found Error: Ghost 'old' could not be found

The same shape written in-source (an annotated class with the same @Ghost) verifies. So does the external spec when the constructor's to also sets the ghost: to = "done(this) && supported(this) == 0".

Real-world scenario. I was writing a spec for javax.management.modelmbean.RequiredModelMBean with a ghost to refuse load()/store(), which always throw; from = "false" doesn't work (#449). With the ghost unset, every correct call such as m.setModelMBeanInfo(info) failed with this error.

Vorherrschende Sprache
Java
Sterne
71
Forks
37
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
57

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus liquid-java/liquidjava

Alle Issues in liquid-java/liquidjava

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.