aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Lahoda <jlahoda@openjdk.org> 2021-04-15 15:16:11 +0000
committerGravatar Jan Lahoda <jlahoda@openjdk.org> 2021-04-15 15:16:11 +0000
commite43aee58e176d43dbec90271c6249c0771de0ef5 (patch)
tree68f20cf7549cdf19d146fa58f3a391eee14c1ed3
parentc70589c68c09d3089b69b46a83c97fb9e86fff42 (diff)
downloadjdk-e43aee58e176d43dbec90271c6249c0771de0ef5.tar.gz
jdk-e43aee58e176d43dbec90271c6249c0771de0ef5.zip
8262900: ToolBasicTest fails to access HTTP server it starts
Reviewed-by: sundar, vromero
-rw-r--r--test/langtools/jdk/jshell/ToolBasicTest.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/langtools/jdk/jshell/ToolBasicTest.java b/test/langtools/jdk/jshell/ToolBasicTest.java
index 41b22b53878..8d8dfc8f9f4 100644
--- a/test/langtools/jdk/jshell/ToolBasicTest.java
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java
@@ -526,7 +526,7 @@ public class ToolBasicTest extends ReplToolTesting {
public void testOpenFileOverHttp() throws IOException {
var script = "int a = 10;int b = 20;int c = a + b;";
- var localhostAddress = new InetSocketAddress(InetAddress.getLocalHost().getHostAddress(), 0);
+ var localhostAddress = new InetSocketAddress(InetAddress.getLoopbackAddress().getHostAddress(), 0);
var httpServer = HttpServer.create(localhostAddress, 0);
try {
httpServer.createContext("/script", exchange -> {