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

A constructor of one class cannot change the state of its argument (new PipedInputStream(pos) connects pos)

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java

Research direction

The issue identifies the @StateRefinement limitation and gives a reproducer using PipedInputStream and PipedOutputStream, but names no implementation files or tests. First read how @StateRefinement is represented and processed, then trace the constructor-spec handling and related tests. Done means a parameter-state transition can be specified and the reproducer is accepted without breaking existing behavior.

Written by the indexing model from the issue text.

Description

enhancement future latte

new PipedInputStream(pos) calls pos.connect(this), so afterwards pos is connected. A spec cannot say this: @StateRefinement describes this (and the return value), not the state of an argument of an external constructor.

PipedOutputStream pos = new PipedOutputStream();
InputStream is = new PipedInputStream(pos);
pos.write(1);   // correct Java

With the Barista PipedOutputStream spec (connected only via new PipedOutputStream(snk) or connect(snk)), main 321a7321 rejects it: found start(pos) but expected connected(pos). Connecting from the input side is the more common idiom; it is how powsybl-core fixed a real 'Pipe not connected' bug, so the developers' fix is rejected.

Proposal: allow a state transition on a parameter in a constructor or method spec, e.g. @StateRefinement(param = "src", to = "connected(src)") on PipedInputStream(PipedOutputStream src).

We would need Latte for this.

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.