src/share/classes/java/net/SocketPermission.java
Print this page
*** 954,968 ****
// we see if the original names/IPs passed in were equal.
String thisHost = hostname;
String thatHost = that.hostname;
! if (thisHost == null)
return false;
! else
return thisHost.equalsIgnoreCase(thatHost);
}
/**
* Checks two SocketPermission objects for equality.
* <P>
* @param obj the object to test for equality with this object.
--- 954,974 ----
// we see if the original names/IPs passed in were equal.
String thisHost = hostname;
String thatHost = that.hostname;
! if (thisHost == null) {
return false;
! } 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);
}
+ }
/**
* Checks two SocketPermission objects for equality.
* <P>
* @param obj the object to test for equality with this object.