Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#380 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Java
星號
67
分支
36
平均合併
2 天 4 小時
30 天內合併 PR
28

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

liquid-java/liquidjava 的其他 Issue

查看 liquid-java/liquidjava 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。