clean up/optimize equals() and hashCode() methods
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 8 Jan 2008 08:12:39 +0000 (08:12 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 8 Jan 2008 08:12:39 +0000 (08:12 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2524 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/session/impl/AuthenticationMethodInformationImpl.java
src/edu/internet2/middleware/shibboleth/idp/session/impl/ServiceInformationImpl.java

index 2cbb6c0..61b700b 100644 (file)
@@ -114,6 +114,10 @@ public class AuthenticationMethodInformationImpl implements AuthenticationMethod
 
     /** {@inheritDoc} */
     public boolean equals(Object obj) {
+        if(obj == this){
+            return true;
+        }
+        
         if (!(obj instanceof AuthenticationMethodInformation)) {
             return false;
         }
index 4cefda0..0dbd976 100644 (file)
@@ -70,6 +70,10 @@ public class ServiceInformationImpl implements ServiceInformation {
 
     /** {@inheritDoc} */
     public boolean equals(Object obj) {
+        if(obj == this){
+            return true;
+        }
+        
         if (!(obj instanceof ServiceInformation)) {
             return false;
         }