jdk/src/share/classes/java/net/Socket.java
changeset 9544 89c6ba8bb6c7
parent 5506 202f599c92aa
child 9550 c3a275ce56d3
--- a/jdk/src/share/classes/java/net/Socket.java	Sun May 01 14:22:32 2011 +0800
+++ b/jdk/src/share/classes/java/net/Socket.java	Mon May 02 11:02:58 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);