RFR 8190500: (ch) ReadableByteChannelImpl::read and WritableByteChannelImpl::write might not throw ClosedChannelException as specified

Brian Burkhalter brian.burkhalter at oracle.com
Thu Nov 2 15:54:21 UTC 2017


On Nov 2, 2017, at 1:30 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 02/11/2017 00:55, Brian Burkhalter wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8190500
>> http://cr.openjdk.java.net/~bpb/8190500/webrev.00/
>> 
>> Closing the channel returned by Channels::newChannel can result in a subsequent read/write's throwing an IOException instead of the expected ClosedChannelException in for a non-FileIn/OutputStream parameter.
>> 
> The change looks okay. Related is that someone with a reference to the underlying InputStream/OutpuStream could close the stream so that the channel read/write throw an IOException other than AsynchronousCloseException but that isn't something you can solve.

Yes, I thought of that also.

> For the test then you might want to break up the really long lines to keep it consistent with the rest of the test.

Done: webrev updated in place.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20171102/ba6642cf/attachment.html>


More information about the nio-dev mailing list