jdk/src/share/classes/java/net/Socket.java
changeset 9775 1b128726e887
parent 9550 c3a275ce56d3
child 10421 2ee16a0f6df5
--- a/jdk/src/share/classes/java/net/Socket.java	Mon May 30 16:37:42 2011 +0100
+++ b/jdk/src/share/classes/java/net/Socket.java	Mon May 30 23:36:10 2011 +0100
@@ -127,11 +127,12 @@
             }
             if (security != null) {
                 if (epoint.isUnresolved())
-                    security.checkConnect(epoint.getHostName(),
-                                          epoint.getPort());
+                    epoint = new InetSocketAddress(epoint.getHostName(), epoint.getPort());
+                if (epoint.isUnresolved())
+                    security.checkConnect(epoint.getHostName(), epoint.getPort());
                 else
                     security.checkConnect(epoint.getAddress().getHostAddress(),
-                                          epoint.getPort());
+                                  epoint.getPort());
             }
             impl = new SocksSocketImpl(p);
             impl.setSocket(this);