On Thu, 8 Oct 2026 11:14:39 GMT, Volkan Yazici <[email protected]> wrote:

>> Michael McMahon has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   net-properties.html update
>
> src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java line 304:
> 
>> 302:     private SocketAddress unixBind(SocketAddress local, int backlog) 
>> throws IOException {
>> 303:         UnixDomainSocketAddress ulocal = (UnixDomainSocketAddress)local;
>> 304:         if (local == null || (ulocal.getPath().toString().equals(""))) {
> 
> Cast needs to be checked first:
> 
> Suggestion:
> 
>         if (local == null || (local instanceof UnixDomainSocketAddress ulocal 
> && ulocal.getPath().toString().equals(""))) {
> 
> 
> A test covering this negative path would also be nice.

Good catch. Address type mismatch is expected to be checked by:

    Path path = UnixDomainSockets.checkAddress(local).getPath();

below. So if we have the wrong address type here it will end up in that call 
and trigger the appropriate exception.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33249#discussion_r4219235366

Reply via email to