Add domain to the PasswordCredentials equality check 56/69656/2
authorStephen Kitt <skitt@redhat.com>
Tue, 20 Mar 2018 08:43:02 +0000 (09:43 +0100)
committerStephen Kitt <skitt@redhat.com>
Tue, 20 Mar 2018 09:41:51 +0000 (10:41 +0100)
Change-Id: Ib719afc87e43f905e460bdcfd3890f99c7b5f5dc
Signed-off-by: Stephen Kitt <skitt@redhat.com>
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialBuilder.java

index 034cfe1f3c8329bec69675745e6c9a7cec656ba8..d35b4a10b61a90a8350095edfdb187d8e3aa629c 100644 (file)
@@ -68,13 +68,14 @@ public class PasswordCredentialBuilder {
             }
             PasswordCredentials passwordCredentials = (PasswordCredentials) object;
             return Objects.equals(username, passwordCredentials.username())
-                    && Objects.equals(password, passwordCredentials.password());
+                    && Objects.equals(password, passwordCredentials.password())
+                    && Objects.equals(domain, passwordCredentials.domain());
         }
 
         @Override
         public int hashCode() {
             if (hashCode == 0) {
-                hashCode = Objects.hash(username, password);
+                hashCode = Objects.hash(username, password, domain);
             }
             return hashCode;
         }