[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...
Shane Bryzak
Shane_Bryzak at symantec.com
Mon Jan 8 23:14:53 EST 2007
User: sbryzak2
Date: 07/01/08 23:14:53
Modified: src/main/org/jboss/seam/security SimplePrincipal.java
Log:
added hashCode() and equals() methods
Revision Changes Path
1.2 +22 -0 jboss-seam/src/main/org/jboss/seam/security/SimplePrincipal.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SimplePrincipal.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/SimplePrincipal.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SimplePrincipal.java 8 Jan 2007 02:55:40 -0000 1.1
+++ SimplePrincipal.java 9 Jan 2007 04:14:53 -0000 1.2
@@ -21,4 +21,26 @@
return name;
}
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Principal))
+ return false;
+
+ Principal other = (Principal) obj;
+
+ if (name == null)
+ return other.getName() == null;
+ else
+ return name.equals(other.getName());
+ }
+
+ public int hashCode()
+ {
+ return name == null ? 0 : name.hashCode();
+ }
+
+ public String toString()
+ {
+ return name;
+ }
}
More information about the jboss-cvs-commits
mailing list