File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
test/hotspot/jtreg/compiler/compilercontrol/share Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2015, 2016 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2015, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@ protected void communicate(String[] args) {
8787 System .out .println ("INFO: Client connection port = " + port );
8888 List <String > lines ;
8989 try (
90- Socket socket = new Socket (InetAddress .getLocalHost (), port );
90+ Socket socket = new Socket (InetAddress .getLoopbackAddress (), port );
9191 BufferedReader in = new BufferedReader (
9292 new InputStreamReader (socket .getInputStream ()));
9393 PrintWriter out = new PrintWriter (
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2015, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2015, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
3636import java .io .InputStreamReader ;
3737import java .io .PrintWriter ;
3838import java .lang .reflect .Executable ;
39+ import java .net .InetAddress ;
40+ import java .net .InetSocketAddress ;
3941import java .net .ServerSocket ;
4042import java .net .Socket ;
4143import java .util .ArrayList ;
@@ -80,8 +82,9 @@ public List<OutputAnalyzer> execute() {
8082 // Add class name that would be executed in a separate VM
8183 vmOptions .add (execClass );
8284 OutputAnalyzer output ;
83- try (ServerSocket serverSocket = new ServerSocket (0 )) {
85+ try (ServerSocket serverSocket = new ServerSocket ()) {
8486 {
87+ serverSocket .bind (new InetSocketAddress (InetAddress .getLoopbackAddress (), 0 ));
8588 // Get port test VM will connect to
8689 int port = serverSocket .getLocalPort ();
8790 if (port == -1 ) {
You can’t perform that action at this time.
0 commit comments