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

Julia Boes julia.boes at oracle.com
Wed Oct 16 09:38:42 UTC 2019


Hi Daniel,

Thanks for reviewing the change. I added a test case as per your suggestion.

Updated webrev: 
http://cr.openjdk.java.net/~jboes/webrevs/8225499/webrev.01/index.html

Regards,

Julia

On 15/10/2019 14:22, Daniel Fuchs wrote:
> 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