RFR: 8367943: PipedOutputStream write(0, 0) successful after close() [v2]

Jaikiran Pai jpai at openjdk.org
Sat Nov 1 07:27:05 UTC 2025


On Fri, 31 Oct 2025 16:27:57 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Update the specification of `java.io.PipedOutputStream.write(byte[],int,int)` to match longstanding behavior. Add a verification to an existing test.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8367943: positive -> greater than zero

These changes look good to me. I only have a comment about the new test which I've added inline.

test/jdk/java/io/PipedOutputStream/WriteAfterClose.java line 45:

> 43:         }
> 44:         try {
> 45:             out.write(new byte[7], 3, 0);

Hello Brian, this test here attempts a write to the `PipedOutputStream` after the `PipedInputStream` is closed. It's slightly different that closing the `PipedOutputStream` itself. Should we add one more test which closes the `PipedOutputStream` and attempts this write?

-------------

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28078#pullrequestreview-3406930286
PR Review Comment: https://git.openjdk.org/jdk/pull/28078#discussion_r2483175252


More information about the core-libs-dev mailing list