mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-16 00:19:27 +00:00
8267544: (test) rmi test NonLocalSkeleton fails if network has multiple adapters with the same address
Reviewed-by: dfuchs
This commit is contained in:
parent
f4531661b5
commit
d8e6e2877a
@ -37,6 +37,7 @@ import java.rmi.server.ObjID;
|
||||
import java.rmi.server.RemoteObjectInvocationHandler;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@ -85,8 +86,8 @@ public class NonLocalSkeletonTest {
|
||||
|
||||
// Check if running the test on a local system; it only applies to remote
|
||||
String myHostName = InetAddress.getLocalHost().getHostName();
|
||||
Set<InetAddress> myAddrs = Set.of(InetAddress.getAllByName(myHostName));
|
||||
Set<InetAddress> hostAddrs = Set.of(InetAddress.getAllByName(host));
|
||||
Set<InetAddress> myAddrs = Set.copyOf(Arrays.asList(InetAddress.getAllByName(myHostName)));
|
||||
Set<InetAddress> hostAddrs = Set.copyOf(Arrays.asList(InetAddress.getAllByName(host)));
|
||||
boolean isLocal = (hostAddrs.stream().anyMatch(i -> myAddrs.contains(i))
|
||||
|| hostAddrs.stream().anyMatch(h -> h.isLoopbackAddress()));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user