RFR: 8225499: InetSocketAddress::toString not friendly to IPv6 literal addresses

Daniel Fuchs daniel.fuchs at oracle.com
Tue Oct 15 13:22:22 UTC 2019


Hi Julia,

This looks good to me.

On the test - maybe we should add a case where the InetAddress
parameter passed to the constructor is null, as I think
InetSocketAddress supports this.

best regards,

-- daniel



On 09/10/2019 12:24, Julia Boes wrote:
> Hi,
> 
> This fix improves the handling of IPv6 addresses in 
> InetSocketAddress::toString. The implementation now encloses the IPv6 
> literal in brackets, which wasn't done previously.
> 
> Example:
> 
> new InetSocketAddress("::1", 80).toString()
> before: /0:0:0:0:0:0:0:1:80
> after: /[0:0:0:0:0:0:0:1]:80
> 
> Additionally, the string format for unresolved addresses is changed to 
> 'hostname/<unresolved>:80' to closer adhere to the format of 
> 'hostname/IP literal:port'.
> 
> Example:
> 
> InetSocketAddress.createUnresolved("foo", 80).toString()
> before: foo:80
> after: foo/<unresolved>:80
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8225499
> 
> Webrev: http://cr.openjdk.java.net/~jboes/webrevs/8225499/webrev.00/
> 
> CSR: https://bugs.openjdk.java.net/browse/JDK-8232002
> 
> 
> Regards,
> 
> Julia
> 
> 



More information about the net-dev mailing list