JDK-8221684 : Correctly format test URI's that contain an IPv6 address retrieved from the host
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 13
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2019-03-29
  • Updated: 2019-03-29
Description
Several tests that retrieve an IP address from the host system, use that in the construction of a URL / URI. If the IP address is an IPv6 address, then it may need to be enclosed in "[" and "]" characters.

Follow-on to JDK-8220575, but with a slightly different pattern, since the tests use getLocalHost, rather than getLoopbackAddress or 127.0.0.1, etc.

Two such tests are:
  test/jdk/sun/net/www/protocol/http/HttpOnly.java
  test/jdk/sun/net/www/protocol/http/NoCache.java

These test don't need to use getLocalHost, they could use the loopback.