You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2018/09/06 09:39:34 UTC

[ambari] branch branch-2.7 updated: AMBARI-24595. PrincipalKeyCredential.equals fails for subtypes (dlysnichenko) (#2249)

This is an automated email from the ASF dual-hosted git repository.

dmitriusan pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 68bf0f4  AMBARI-24595. PrincipalKeyCredential.equals fails for subtypes (dlysnichenko) (#2249)
68bf0f4 is described below

commit 68bf0f42df2addcec48be18dfc4d4ab9176afc37
Author: Lisnichenko Dmitro <dm...@apache.org>
AuthorDate: Thu Sep 6 12:39:32 2018 +0300

    AMBARI-24595. PrincipalKeyCredential.equals fails for subtypes (dlysnichenko) (#2249)
---
 .../ambari/server/security/credential/PrincipalKeyCredential.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/credential/PrincipalKeyCredential.java b/ambari-server/src/main/java/org/apache/ambari/server/security/credential/PrincipalKeyCredential.java
index 9d5ae22..4133250 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/credential/PrincipalKeyCredential.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/credential/PrincipalKeyCredential.java
@@ -114,7 +114,7 @@ public class PrincipalKeyCredential implements Credential {
       return false;
     } else if (this == obj) {
       return true;
-    } else if (obj.getClass() == PrincipalKeyCredential.class) {
+    } else if (obj.getClass() == this.getClass()) {
       PrincipalKeyCredential other = (PrincipalKeyCredential) obj;
       return ((this.principal == null) ? (other.principal == null) : this.principal.equals(other.principal)) &&
           ((this.key == null) ? (other.key == null) : Arrays.equals(this.key, other.key));