< prev index next >

src/java.base/share/classes/java/net/InetAddress.java

Print this page

        

@@ -47,10 +47,11 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.Arrays;
 
 import jdk.internal.access.JavaNetInetAddressAccess;
 import jdk.internal.access.SharedSecrets;
+import jdk.internal.misc.Blocker;
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
 
 /**

@@ -918,17 +919,17 @@
     private static final class PlatformNameService implements NameService {
 
         public InetAddress[] lookupAllHostAddr(String host)
             throws UnknownHostException
         {
-            return impl.lookupAllHostAddr(host);
+            return Blocker.run(() -> impl.lookupAllHostAddr(host));
         }
 
         public String getHostByAddr(byte[] addr)
             throws UnknownHostException
         {
-            return impl.getHostByAddr(addr);
+            return Blocker.run(() -> impl.getHostByAddr(addr));
         }
     }
 
     /**
      * The HostsFileNameService provides host address mapping
< prev index next >