jdk/src/share/classes/java/net/SocketPermission.java
changeset 10124 a00341fc41db
parent 9775 1b128726e887
child 10596 39b3a979e600
equal deleted inserted replaced
10123:fd5d08550d66 10124:a00341fc41db
   954         // we see if the original names/IPs passed in were equal.
   954         // we see if the original names/IPs passed in were equal.
   955 
   955 
   956         String thisHost = hostname;
   956         String thisHost = hostname;
   957         String thatHost = that.hostname;
   957         String thatHost = that.hostname;
   958 
   958 
   959         if (thisHost == null)
   959         if (thisHost == null) {
   960             return false;
   960             return false;
   961         else
   961         } else if (this.wildcard) {
       
   962             final int cnameLength = this.cname.length();
       
   963             return thatHost.regionMatches(true,
       
   964                                           (thatHost.length() - cnameLength),
       
   965                                           this.cname, 0, cnameLength);
       
   966         } else {
   962             return thisHost.equalsIgnoreCase(thatHost);
   967             return thisHost.equalsIgnoreCase(thatHost);
       
   968         }
   963     }
   969     }
   964 
   970 
   965     /**
   971     /**
   966      * Checks two SocketPermission objects for equality.
   972      * Checks two SocketPermission objects for equality.
   967      * <P>
   973      * <P>