RFR: 8256461: AbstractFileSystemProvider.getSunPathForSocketCall for empty Path returns '.'
Michael McMahon
michaelm at openjdk.java.net
Tue Nov 17 15:06:02 UTC 2020
On Tue, 17 Nov 2020 13:42:46 GMT, Michael McMahon <michaelm at openjdk.org> 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.
>
> Thanks,
> Michael.
> _Mailing list message from [Alan Bateman](mailto:Alan.Bateman at oracle.com) on [nio-dev](mailto:nio-dev at openjdk.java.net):_
>
> On 17/11/2020 14:05, Michael McMahon wrote:
>
> > The problem is that bind already throws a BindException, but for a
> > different (confusing and incorrect)
> > reason. I didn't really want to put a test in checking the exception
> > text, and thought a white box test
> > of the lower level method might be better.
>
> I would prefer if there were a test in the unixdomain directory for
> this. If there is no way to test this with the bind method then maybe
> you could move the test for getSunPathForSocketFile to that location. My
> main concern is that it complicates local testing when working on the
> file system API. The getSunPathForSocketFile is for Unix domain socket
> use only.
>
> -Alan
Okay, I'll move the test then.
- Michael
-------------
PR: https://git.openjdk.java.net/jdk/pull/1258
More information about the nio-dev
mailing list