RFR: 8306308: (ch) Writer created by Channels::newWriter may lose data [v2]

Brian Burkhalter bpb at openjdk.org
Wed Oct 18 20:40:23 UTC 2023


On Wed, 18 Oct 2023 14:43:04 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - 8306308: Remove WritableByteChannel support from StreamEncoder
>>  - 8306308: new OutputStreamWriter -> StreamEncoder.forOutputStreamWriter
>
> src/java.base/share/classes/java/nio/channels/Channels.java line 546:
> 
>> 544:         Objects.requireNonNull(enc, "enc");
>> 545:         return StreamEncoder.forOutputStreamWriter(newOutputStream(ch),
>> 546:             new Object(), enc.reset());
> 
> I'm not sure about this lock Object, you may have to add a 2-arg forOutputstreamWriter so that the no-arg Writer is used.

Done in 366e42c54ef8f04f542f93b5a73a8ad41e60a322.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16207#discussion_r1364506375


More information about the nio-dev mailing list