Skip to content
Permalink
Browse files
8267544: (test) rmi test NonLocalSkeleton fails if network has multip…
…le adapters with the same address

Reviewed-by: dfuchs
  • Loading branch information
Roger Riggs committed May 24, 2021
1 parent f453166 commit d8e6e2877aa8a89ad403f06b0adea19c7896d834
Showing with 3 additions and 2 deletions.
  1. +3 −2 test/jdk/java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java
@@ -37,6 +37,7 @@
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 static void main(String[] args) throws Exception {

// 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()));

1 comment on commit d8e6e28

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on d8e6e28 May 24, 2021

Please sign in to comment.