Refine SimplePrincipal equals() method
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 24 Feb 2015 20:45:44 +0000 (20:45 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 24 Feb 2015 20:45:44 +0000 (20:45 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@7940 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.util/src/org/argeo/util/security/SimplePrincipal.java

index c7a4daf123168199ba39a2574651bca165cce861..03c573e2560a2175bcceefbc8aa1e01e38563693 100644 (file)
@@ -42,6 +42,8 @@ public class SimplePrincipal implements Principal {
        public boolean equals(Object obj) {
                if (obj == null)
                        return false;
+               if (obj instanceof Principal)
+                       return name.equals((((Principal) obj).getName()));
                return name.equals(obj.toString());
        }