geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject [geode] branch develop updated: GEODE-5986 Inconsistent equals/hashCode
Date Thu, 18 Apr 2019 18:09:50 GMT
This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 104268a  GEODE-5986 Inconsistent equals/hashCode
104268a is described below

commit 104268aeca5d4fc52c7e421a904ef0ac1601a20c
Author: nabarunnag <nag@cs.wisc.edu>
AuthorDate: Mon Apr 15 22:54:16 2019 -0700

    GEODE-5986 Inconsistent equals/hashCode
    
    	* Added hashCode methods to classes that were missing one.
---
 .../java/org/apache/geode/cache30/CacheXMLPartitionResolver.java  | 8 +++++++-
 .../cache/partitioned/fixed/QuarterPartitionResolver.java         | 7 +++++++
 .../partitioned/fixed/SingleHopQuarterPartitionResolver.java      | 7 +++++++
 .../geode/internal/cache/execute/CustomerIDPartitionResolver.java | 6 ++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXMLPartitionResolver.java
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXMLPartitionResolver.java
index d227e81..5e8e397 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXMLPartitionResolver.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXMLPartitionResolver.java
@@ -16,6 +16,7 @@ package org.apache.geode.cache30;
 
 
 import java.io.Serializable;
+import java.util.Objects;
 import java.util.Properties;
 
 import org.apache.geode.cache.EntryOperation;
@@ -43,7 +44,12 @@ public class CacheXMLPartitionResolver implements PartitionResolver, Serializabl
   @Override
   public void close() {}
 
-  // @Override
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(this.resolveProps);
+  }
+
+  @Override
   public boolean equals(Object obj) {
     if (this == obj) {
       return true;
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/QuarterPartitionResolver.java
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/QuarterPartitionResolver.java
index ce4d5fa..378cbee 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/QuarterPartitionResolver.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/QuarterPartitionResolver.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.Set;
 
@@ -89,6 +90,12 @@ public class QuarterPartitionResolver
     return this.numBuckets;
   }
 
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(this.resolveProps);
+  }
+
+  @Override
   public boolean equals(Object obj) {
     if (this == obj) {
       return true;
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/SingleHopQuarterPartitionResolver.java
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/SingleHopQuarterPartitionResolver.java
index 67c311a..598f485 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/SingleHopQuarterPartitionResolver.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/SingleHopQuarterPartitionResolver.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.Set;
 
@@ -121,6 +122,12 @@ public class SingleHopQuarterPartitionResolver
     return this.numBuckets;
   }
 
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(this.resolveProps);
+  }
+
+  @Override
   public boolean equals(Object obj) {
     if (this == obj) {
       return true;
diff --git a/geode-dunit/src/main/java/org/apache/geode/internal/cache/execute/CustomerIDPartitionResolver.java
b/geode-dunit/src/main/java/org/apache/geode/internal/cache/execute/CustomerIDPartitionResolver.java
index 69012e4..33a6b7f 100644
--- a/geode-dunit/src/main/java/org/apache/geode/internal/cache/execute/CustomerIDPartitionResolver.java
+++ b/geode-dunit/src/main/java/org/apache/geode/internal/cache/execute/CustomerIDPartitionResolver.java
@@ -15,6 +15,7 @@
 package org.apache.geode.internal.cache.execute;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 import org.apache.geode.cache.EntryOperation;
 import org.apache.geode.cache.PartitionResolver;
@@ -75,4 +76,9 @@ public class CustomerIDPartitionResolver implements PartitionResolver {
 
   }
 
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(id);
+  }
+
 }


Mime
View raw message