Browse Source

SEC-458: implementy hashCode() in PrincipalSid and GrantedAuthoritySid.

Luke Taylor 18 years ago
parent
commit
0efa5c3090

+ 4 - 0
core/src/main/java/org/acegisecurity/acls/sid/GrantedAuthoritySid.java

@@ -57,6 +57,10 @@ public class GrantedAuthoritySid implements Sid {
         return ((GrantedAuthoritySid) object).getGrantedAuthority().equals(this.getGrantedAuthority());
     }
 
+    public int hashCode() {
+        return this.getGrantedAuthority().hashCode();
+    }
+
     public String getGrantedAuthority() {
         return grantedAuthority;
     }

+ 4 - 0
core/src/main/java/org/acegisecurity/acls/sid/PrincipalSid.java

@@ -62,6 +62,10 @@ public class PrincipalSid implements Sid {
         return ((PrincipalSid) object).getPrincipal().equals(this.getPrincipal());
     }
 
+    public int hashCode() {
+        return this.getPrincipal().hashCode();
+    }
+
     public String getPrincipal() {
         return principal;
     }