RFR: 8280881: (fs) UnixNativeDispatcher.close0 may throw UnixException [v2]
Jaikiran Pai
jpai at openjdk.java.net
Thu Feb 17 04:14:13 UTC 2022
On Wed, 16 Feb 2022 00:53:02 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> This might be a good idea. I think I need to revisit all the changes in this patch.
>
> In commit 0e7b72f I elected to do the following:
>
> 1. If `close()` throws a `UnixException` in a finally block, then it is ignored unless it can be ascertained that it would would _not_ mask an exception thrown in the try block, in which case it is rethrown as an `IOException`.
> 2. The `UnixException` is also ignored if the calling method does not throw `IOException`.
> 3. If the `UnixException` can be added as a suppressed exception to a preexisting `IOException` then that is done.
> 4. Otherwise if the `UnixException` can be rethrown as an `IOException` without masking another exception than that is done.
Thank you for these changes, Brian. Overall these look fine to me. There's one part in this change which I'm unsure about given my lack of knowledge - the place where we throw an `IOException` depending on whether or not the operation is `done` or `complete`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7467
More information about the nio-dev
mailing list