RFR: 8256461: AbstractFileSystemProvider.getSunPathForSocketCall for empty Path returns '.'

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 17 14:00:57 UTC 2020



On 17/11/2020 13:47, Michael McMahon wrote:
> Could I get the following change reviewed please?
>
> The problem results from AbstractFileSystemProvider.getSunPathForSocketCall  returning a path of '.' when given an empty path argument. The socket API needs an empty path byte[] in this situation. It causes a BindException which is actually correct, but the error message is confusing because "." always exists and the error message is saying 'path already exists' when the actual error is that server socket channels cannot be bound to the empty path.
Can method description of getSunPathForSocketPath be updated to align 
with the new behavior? Also can you fix the exception in 
UnixDomainSocekts so that the casing is consistent with the other 
exceptions.

I don't think test/sun/nio/fs is the right place for the test. Would it 
be better to create a test in test/jdk/java/nio/channels/unixdomain to 
check that bind throws an exception?

-Alan.


More information about the nio-dev mailing list