Reported on core-libs-dev and further discussed here:
The issue here seems to be that InetSocketAddress::toString is specified to call InetAddress.toString() and concatenate :<port>. This doesn't align with the implementation and is also not friendly to IPv6 literal addresses, eg:
new InetSocketAddress("::1", 8080).toString()
prints "/0:0:0:0:0:0:0:1:8080" when users will expect "[::1]:80)" (no slash).