< prev index next >

src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java

Print this page
rev 15821 : 8165271: Fix use of reflection to gain access to private fields
Reviewed-by:

@@ -24,13 +24,23 @@
  */
 
 package jdk.internal.misc;
 
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 public interface JavaNetInetAddressAccess {
     /**
      * Return the original application specified hostname of
      * the given InetAddress object.
      */
     String getOriginalHostName(InetAddress ia);
+    
+    /**
+     * Get the InetAddress of the provided host. If an InetAddress is provided
+     * then it will be the default address returned for all calls to either
+     * form of getByName. This is required to maintain consistency when
+     * caching addresses and hostnames.
+     */
+    InetAddress getByName(String hostName, InetAddress hostAddress)
+            throws UnknownHostException;
 }
< prev index next >