accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-4029 more better hashCode
Date Mon, 19 Oct 2015 14:48:57 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master a80138315 -> 52ba24e32


ACCUMULO-4029 more better hashCode


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

Branch: refs/heads/master
Commit: 5ca779a0e5c33f83a3215c0a0211d01747a0a19f
Parents: 3f1346c
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Mon Oct 19 10:47:48 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Mon Oct 19 10:47:48 2015 -0400

----------------------------------------------------------------------
 core/src/main/java/org/apache/accumulo/core/data/Mutation.java     | 2 +-
 core/src/test/java/org/apache/accumulo/core/data/MutationTest.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ca779a0/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/Mutation.java b/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
index 5b052c3..e4e229c 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
@@ -598,7 +598,7 @@ public class Mutation implements Writable {
 
   @Override
   public int hashCode() {
-    return toThrift(false).hashCode();
+    return serializedSnapshot().hashCode();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5ca779a0/core/src/test/java/org/apache/accumulo/core/data/MutationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/data/MutationTest.java b/core/src/test/java/org/apache/accumulo/core/data/MutationTest.java
index 740baa7..21272ff 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/MutationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/MutationTest.java
@@ -580,6 +580,8 @@ public class MutationTest {
     assertEquals(m1, m1);
     assertEquals(m1, m2);
     assertEquals(m2, m1);
+    assertEquals(m2.hashCode(), m1.hashCode());
+    assertFalse(0 == m1.hashCode());
     assertFalse(m1.equals(m3));
     assertFalse(m3.equals(m1));
     assertFalse(m1.equals(m4));


Mime
View raw message