Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-22 Thread Chris Hegarty
Arthur, > On 22 Mar 2019, at 17:07, Arthur Eubanks wrote: > > Sounds good, I'll work on that. > > On Fri, Mar 22, 2019 at 10:02 AM Chris Hegarty > wrote: > ... > Daniel has prototyped something > similar for the URI update investigation work. > Here is a lin

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-22 Thread Arthur Eubanks
Sounds good, I'll work on that. On Fri, Mar 22, 2019 at 10:02 AM Chris Hegarty wrote: > Arthur, > > > On 19 Mar 2019, at 15:31, Arthur Eubanks wrote: > > > > (Sorry for the late response, I keep getting sidetracked by other stuff) > > > > Is there a reason you're trying to deprecate the URL con

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-22 Thread Chris Hegarty
Arthur, > On 19 Mar 2019, at 15:31, Arthur Eubanks wrote: > > (Sorry for the late response, I keep getting sidetracked by other stuff) > > Is there a reason you're trying to deprecate the URL constructors? Yes, they are generally more error-prone than using URI, since they don’t encode illegal

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-19 Thread Arthur Eubanks
(Sorry for the late response, I keep getting sidetracked by other stuff) Is there a reason you're trying to deprecate the URL constructors? And if we end up not using the URL constructors, then I still think it would be nice to have a test library, since it's easy to forget to add the "[]". Unles

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-14 Thread Chris Hegarty
Arthur, > On 14 Mar 2019, at 17:44, Arthur Eubanks wrote: > > Most of these eventually turn the String into a URL, so using a URL directly > should work? URL constructors will work, but I would prefer to not add any more usages of these than we already have. I plan to start a discussion about

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-14 Thread Arthur Eubanks
Most of these eventually turn the String into a URL, so using a URL directly should work? jshell> URL u = new URL("http", "::1", 9002, "/") u ==> http://[::1]:9002/ jshell> URL u = new URL("http", InetAddress.getLoopbackAddress().getHostAddress(), 9002, "/") u ==> http://127.0.0.1:9002/ jshell> UR

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-14 Thread Chris Hegarty
It's just a hack, but enough to get me started so I can asses some of what is needed to support running the tests on an IPv6-only environment. http://cr.openjdk.java.net/~chegar/ipv6-only-hack/ My /etc/hosts file has entries for `localhost` and the _host_, that return `::1`. This is enough

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-13 Thread Martin Buchholz
On Wed, Mar 13, 2019 at 11:24 AM Daniel Fuchs wrote: > > jshell> InetAddress.getLoopbackAddress().getHostName() > $7 ==> "localhost" > > jshell> InetAddress.getAllByName("localhost"); > $8 ==> InetAddress[3] { >localhost/127.0.0.1, >localhost/0:0:0:0:0:0:0:1, >

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-13 Thread Chris Hegarty
Daniel, On 13/03/2019 18:22, Daniel Fuchs wrote: Hi Chris, On 13/03/2019 17:32, Chris Hegarty wrote: I think that is most cases it should be possible to just replace the use of `getHostAddress` with `getHostName`. This defers the actual lookup to the system configured name service ( rather tha

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-13 Thread Daniel Fuchs
Hi Arthur, On 13/03/2019 17:43, Arthur Eubanks wrote: Martin suggested looping through all available loopback addresses rather than hardcoding them. In that case we'll need helper test functions to return loopback addresses (and test that it actually returns all available loopback addresses).

Re: Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-13 Thread Daniel Fuchs
Hi Chris, On 13/03/2019 17:32, Chris Hegarty wrote: I think that is most cases it should be possible to just replace the use of `getHostAddress` with `getHostName`. This defers the actual lookup to the system configured name service ( rather than trying to encode IPv6 addresses in the test ) I

Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address

2019-03-13 Thread Chris Hegarty
I filed the 8220575 [1] that tracks "Correctly format test URI's that contain a retrieved IPv6 address" Regarding fixing tests that incorrectly use IPv6 addresses in URL's or URI's, without enclosing the address within '[' and ']' ( square brackets ). These IPv6 addresses typically come from eith