RFR: 8280881: (fs) UnixNativeDispatcher.close0 may throw UnixException [v2]
Alan Bateman
alanb at openjdk.java.net
Fri Feb 18 15:40:47 UTC 2022
On Wed, 16 Feb 2022 00:44:37 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Re-specify `sun.nio.fs.UnixNativeDispatcher.close0()` to throw `sun.nio.fs.UnixException` and modify callers either to ignore it or to rethrow it as an `IOException`, as appropriate.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8280881: Correct previous version; make Linux changes
One idea to try is to add:
static void close(int fd, Function<UnixException, IOException> mapper) throws IOException
That would eliminate the need to wrap close everywhere. It would replace them with code like:
close(fd, e -> e.asIOException(source));
-------------
PR: https://git.openjdk.java.net/jdk/pull/7467
More information about the nio-dev
mailing list