Fix PropertyKey.hashcode() method.

Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/83e10dbe
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/83e10dbe
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/83e10dbe

Branch: refs/heads/master
Commit: 83e10dbeebe49b2937dc2aaaad647b6a370b9c2f
Parents: ca05c3d
Author: Lei Xia <l...@linkedin.com>
Authored: Mon Sep 18 17:27:40 2017 -0700
Committer: Junkai Xue <j...@linkedin.com>
Committed: Mon Nov 6 17:08:11 2017 -0800

----------------------------------------------------------------------
 helix-core/src/main/java/org/apache/helix/PropertyKey.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/83e10dbe/helix-core/src/main/java/org/apache/helix/PropertyKey.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/PropertyKey.java 
b/helix-core/src/main/java/org/apache/helix/PropertyKey.java
index 7f1d5d9..b198ac2 100644
--- a/helix-core/src/main/java/org/apache/helix/PropertyKey.java
+++ b/helix-core/src/main/java/org/apache/helix/PropertyKey.java
@@ -86,9 +86,9 @@ public class PropertyKey {
 
   @Override
   public int hashCode() {
-    int result = _type.hashCode();
+    int result = (_type != null ? _type.hashCode() : 0);
     result = 31 * result + Arrays.hashCode(_params);
-    result = 31 * result + _typeClazz.hashCode();
+    result = 31 * result + (_typeClazz != null ? _typeClazz.hashCode() : 0);
     result = 31 * result + (_configScope != null ? _configScope.hashCode() : 
0);
     return result;
   }

Reply via email to