GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Soundness: a field read in another method is assumed to still hold its initializer · Issue #340 · liquid-java/liquidjava

Soundness: a field read in another method is assumed to still hold its initializer #340

New issue
Copy link
New issue
Copy link
Open
#393
Open
Soundness: a field read in another method is assumed to still hold its initializer#340
#393
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@CatarinaGamboa
CatarinaGamboa
opened on Oct 6, 2026
Issue body actions

Impact: a real bug passes verification (false negative). It blocks 1 of the 48 real-code examples we built (bugs mined from open-source Java).

Description

A non-final field assigned elsewhere (setQ sets any value) is read in write() as if it still held its initializer 0.75f, so passing it to a parameter refined 0.0 <= _ <= 1.0 is accepted. With a bad initializer the same read is reported (control), so the initializer is what is assumed.

Minimal reproducer

import liquidjava.specification.Refinement;

public class Repro {
    private float q = 0.75f;

    public void setQ(float v) {
        this.q = v;         // any value
    }

    static void use(@Refinement("_ >= 0.0 && _ <= 1.0") float quality) {}

    void write() {
        use(q);             // accepted: q is assumed to still be 0.75
    }
}

Expected

The read of q in write() cannot be proved in range (the field may have been reassigned), as for an unconstrained value.

Actual

Correct! Passed Verification.

Control: the same code without the problem construct is reported

import liquidjava.specification.Refinement;

public class Control {
    private float q = 5.0f;

    public void setQ(float v) {
        this.q = v;
    }

    static void use(@Refinement("_ >= 0.0 && _ <= 1.0") float quality) {}

    void write() {
        use(q);             // with a bad initializer: reported, so the initializer is what is assumed
    }
}
Refinement Error: quality² == 5.0 is not a subtype of quality² >= 0.0 && quality² <= 1.0
11 | 
12 |     void write() {
13 |         use(q);             // with a bad initializer: reported, so the initializer is what is assumed
   |         ^^^^^^^
14 |     }

Reproduced on main at 0472025 (liquidjava-verifier 0.0.35); also on fbfb4e2 and 0.0.33 in the original form. Related: #315-#318 (other field refinement issues).

Context

Found while turning bugs mined from real open-source Java (fixed upstream or still present) into study examples for the error-message study.

Activity

  1. CatarinaGamboa
    added
    bugSomething isn't workingSomething isn't working
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.