ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [31/50] ignite git commit: Fixed NPE inf GridCacheInternalKeyImpl.
Date Tue, 20 Jun 2017 06:00:33 GMT
Fixed NPE inf GridCacheInternalKeyImpl.


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

Branch: refs/heads/ignite-2.1.2-exchange
Commit: b172b4b27b07d09e726faf0a3e41747d6158cdc8
Parents: 52626df
Author: devozerov <vozerov@gridgain.com>
Authored: Sat Jun 17 17:31:35 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Sat Jun 17 17:31:35 2017 +0300

----------------------------------------------------------------------
 .../datastructures/GridCacheInternalKeyImpl.java      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b172b4b2/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheInternalKeyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheInternalKeyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheInternalKeyImpl.java
index eaabef7..5cd3d85 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheInternalKeyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheInternalKeyImpl.java
@@ -74,14 +74,24 @@ public class GridCacheInternalKeyImpl implements GridCacheInternalKey,
Externali
     /** {@inheritDoc} */
     @Override public int hashCode() {
         int result = name != null ? name.hashCode() : 0;
+
         result = 31 * result + (grpName != null ? grpName.hashCode() : 0);
+
         return result;
     }
 
     /** {@inheritDoc} */
     @Override public boolean equals(Object obj) {
-        return this == obj || (obj instanceof GridCacheInternalKey && name.equals(((GridCacheInternalKey)obj).name())
-            && grpName.equals(((GridCacheInternalKey)obj).groupName()));
+        if (this == obj)
+            return true;
+
+        if (obj instanceof GridCacheInternalKeyImpl) {
+            GridCacheInternalKeyImpl other = (GridCacheInternalKeyImpl)obj;
+
+            return F.eq(name, other.name) && F.eq(grpName, other.grpName);
+        }
+
+        return false;
     }
 
     /** {@inheritDoc} */


Mime
View raw message