jdk/src/share/classes/java/net/SocketPermission.java
changeset 10124 a00341fc41db
parent 9775 1b128726e887
child 10596 39b3a979e600
--- a/jdk/src/share/classes/java/net/SocketPermission.java	Mon Jul 18 13:10:02 2011 +0100
+++ b/jdk/src/share/classes/java/net/SocketPermission.java	Mon Jul 18 22:25:58 2011 +0100
@@ -956,10 +956,16 @@
         String thisHost = hostname;
         String thatHost = that.hostname;
 
-        if (thisHost == null)
+        if (thisHost == null) {
             return false;
-        else
+        } else if (this.wildcard) {
+            final int cnameLength = this.cname.length();
+            return thatHost.regionMatches(true,
+                                          (thatHost.length() - cnameLength),
+                                          this.cname, 0, cnameLength);
+        } else {
             return thisHost.equalsIgnoreCase(thatHost);
+        }
     }
 
     /**