RFR: 8274883: (se) Selector.open throws IAE when the default file system provider is changed to a custom provider [v2]
Maxim Kartashev
duke at openjdk.java.net
Mon Dec 6 15:09:58 UTC 2021
On Mon, 6 Dec 2021 13:32:56 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Maxim Kartashev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Addressed PR comments:
>>
>> - renamed UNNAMEDHolder to UnnamedHolder,
>> - renamed getUNNAMED() to unnamed(),
>> - replaced catch IllegalArgumentException with a check for the provider.
>
> src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java line 47:
>
>> 45: private UnixDomainSockets() { }
>> 46:
>> 47: private static class UNNAMEDHolder {
>
> Let's rename this to UnamedHolder to avoid this strange class name.
Also renamed.
> src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java line 143:
>
>> 141: throw new BindException("Invalid temporary directory");
>> 142: } catch (IllegalArgumentException e) {
>> 143: throw new UnsupportedOperationException("Unix Domain Sockets not supported on non-default file system");
>
> There should be no need to catch IAE here, instead you can check the provider.
Changed to `if (path.getFileSystem().provider() != sun.nio.fs.DefaultFileSystemProvider.instance()) ...`
I hope that was what you meant.
> src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java line 186:
>
>> 184: }
>> 185:
>> 186: static UnixDomainSocketAddress getUNNAMED() {
>
> Can you rename this to unnamed() and move it up with the other package default static methods?
Thanks for reviewing!
Renamed to `unnamed()`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6722
More information about the nio-dev
mailing list