JDK-8232369 : Release Note: InetSocketAddress.toString Format Changes for IPv6 Literals and Unresolved Addresses
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 14
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-10-16
  • Updated: 2020-04-27
  • Resolved: 2019-11-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 14
14Resolved
Description
The method `InetSocketAddress::toString` has been improved regarding the handling of IPv6 addresses. The implementation now encloses the IPv6 literal in brackets, which adheres to the specification outlined in <a href="https://tools.ietf.org/html/rfc2732" target="_blank">RFC2732</a>.

Additionally, the string format for unresolved addresses has been changed. The method now represents the literal IP address with the token `<unresolved>`, for example: `foo/<unresolved>:80` instead of `foo:80`. This is based on `InetAddress::toString`, which returns a string of the form "hostname / literal IP address".
To retrieve a string representation of the hostname, or the string form of the address if it doesn't have a hostname, use `InetSocketAddress::getHostString`, rather than parsing the string representation.