7020888: (file) Miscellaneous and trivial clean-ups (typos and opportunities to use suppressed exceptions)
Chris Hegarty
chris.hegarty at oracle.com
Mon Feb 21 02:50:13 PST 2011
The changes look fine to me. I'm happy to see the close exceptions are
no longer being ignored.
-Chris.
On 20/02/2011 16:45, Alan Bateman wrote:
> Mike Duigou wrote:
>> All look good to me. Catching Throwable in SocketChannel does looks a
>> little suspiciously broad. Other non-IOExceptions thrown in the
>> context of the sc.close() would cause the original x to be lost. One
>> can imagine an OutOfMemoryError being thrown especially if x is also
>> an OME.
>>
>> Mike
>>
> Thanks Mike. On catching throwable, I think the more precise rethrow
> works well here and avoids needing to catch each of the possible runtime
> exceptions that connect can throw. In addition it gives us the chance to
> close the channel's socket in the event that an Error is thrown. On
> close throwing something other than IOException then you are right, this
> would supplant the exception, just not sure if it's worth worrying about.
>
> -Alan.
More information about the nio-dev
mailing list