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:32:04 UTC

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

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 8055899  AMBARI-24595. PrincipalKeyCredential.equals fails for subtypes (dlysnichenko) (#2250)
8055899 is described below

commit 8055899fa892c0e6425cb70d97088491a0398267
Author: Lisnichenko Dmitro <dm...@apache.org>
AuthorDate: Thu Sep 6 12:31:59 2018 +0300

    AMBARI-24595. PrincipalKeyCredential.equals fails for subtypes (dlysnichenko) (#2250)
---
 .../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));