diff -r c012b93297b0 -r ec34ae013fbe test/jdk/java/net/httpclient/VersionTest.java --- a/test/jdk/java/net/httpclient/VersionTest.java Thu Mar 08 17:41:52 2018 +0000 +++ b/test/jdk/java/net/httpclient/VersionTest.java Thu Mar 08 17:42:16 2018 +0000 @@ -37,6 +37,7 @@ import com.sun.net.httpserver.HttpServer; import java.io.IOException; import java.io.OutputStream; +import java.net.InetAddress; import java.net.URI; import java.net.InetSocketAddress; import java.net.ProxySelector; @@ -102,7 +103,7 @@ } static void initServer() throws Exception { - InetSocketAddress addr = new InetSocketAddress (0); + InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); s1 = HttpServer.create (addr, 0); HttpHandler h = new Handler(); @@ -113,11 +114,11 @@ s1.start(); port = s1.getAddress().getPort(); - uri = new URI("http://127.0.0.1:" + Integer.toString(port) + "/foo"); + uri = new URI("http://localhost:" + Integer.toString(port) + "/foo"); System.out.println("HTTP server port = " + port); proxy = new ProxyServer(0, false); int proxyPort = proxy.getPort(); - proxyAddr = new InetSocketAddress("127.0.0.1", proxyPort); + proxyAddr = new InetSocketAddress(InetAddress.getLoopbackAddress(), proxyPort); } static class Handler implements HttpHandler { @@ -149,4 +150,4 @@ t.close(); } } -} \ No newline at end of file +}