User: user57
Date: 01/07/30 17:28:40
Modified: src/main/org/jboss/security Tag: jboss_buildmagic
SimplePrincipal.java
Log:
o updating from main
Revision Changes Path
No revision
No revision
1.4.4.1 +10 -8 jboss/src/main/org/jboss/security/SimplePrincipal.java
Index: SimplePrincipal.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/security/SimplePrincipal.java,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -u -r1.4 -r1.4.4.1
--- SimplePrincipal.java 2001/06/18 20:01:28 1.4
+++ SimplePrincipal.java 2001/07/31 00:28:40 1.4.4.1
@@ -25,18 +25,20 @@
this.name = name;
}
- /** Compare this SimplePrincipal's name against another SimplePrincipal
- name or null if this.getName() is null.
- @return true if name == another == null || name equals
- another.toString();
+ /** Compare this SimplePrincipal's name against another Principal
+ @return true if name equals another.getName();
*/
public boolean equals(Object another)
{
- if (name == null)
- return (another == null);
- if ((another == null) || !(another instanceof SimplePrincipal))
+ if( !(another instanceof Principal) )
return false;
- return name.equals( another.toString() );
+ String anotherName = ((Principal)another).getName();
+ boolean equals = false;
+ if( name == null )
+ equals = anotherName == null;
+ else
+ equals = name.equals(anotherName);
+ return equals;
}
public int hashCode()
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development