A constructor of one class cannot change the state of its argument (new PipedInputStream(pos) connects pos)
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
- Domain
- compilers, developer-experience
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from liquid-java/liquidjava
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
liquid-java/liquidjava#373 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
liquid-java/liquidjava#321 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
liquid-java/liquidjava#381 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
liquid-java/liquidjava#379 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
liquid-java/liquidjava#378 ·
Maintainers usually reply within 1 day
All issues in liquid-java/liquidjava
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NationalSecurityAgency/ghidra#9748 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
spring-mcp-tools
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
explyt/spring-plugin#591 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jenkinsci/build-monitor-plugin#1367 ·
Maintainers usually reply within 1 day