< prev index next >

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

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

@@ -319,10 +319,17 @@
         SharedSecrets.setJavaNetInetAddressAccess(
                 new JavaNetInetAddressAccess() {
                     public String getOriginalHostName(InetAddress ia) {
                         return ia.holder.getOriginalHostName();
                     }
+                    
+                    public InetAddress getByName(String hostName,
+                                                 InetAddress hostAddress)
+                            throws UnknownHostException
+                    {
+                        return InetAddress.getByName(hostName, hostAddress);
+                    }
                 }
         );
         init();
     }
 
< prev index next >