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

jiangtian pushed a commit to branch fix_hashcode
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit e6d6b82c8bc7569f9f38e238ccf1edb3da801928
Author: 江天 <[email protected]>
AuthorDate: Sat Apr 27 14:09:50 2019 +0800

    fix in proper hashcode methods in processors
---
 .../engine/bufferwrite/BufferWriteProcessor.java   | 15 ++--------
 .../db/engine/overflow/io/OverflowProcessor.java   | 33 ++--------------------
 2 files changed, 4 insertions(+), 44 deletions(-)

diff --git 
a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
index e770e85..98135ab 100644
--- 
a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
+++ 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
@@ -550,23 +550,12 @@ public class BufferWriteProcessor extends Processor {
 
   @Override
   public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    if (!super.equals(o)) {
-      return false;
-    }
-    BufferWriteProcessor that = (BufferWriteProcessor) o;
-    return Objects.equals(baseDir, that.baseDir) &&
-        Objects.equals(fileName, that.fileName);
+    return this == o;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(super.hashCode(), baseDir, fileName);
+    return Objects.hash(super.hashCode());
   }
 
   @Override
diff --git 
a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
index 656932b..9905c46 100644
--- 
a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
+++ 
b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
@@ -700,41 +700,12 @@ public class OverflowProcessor extends Processor {
 
   @Override
   public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    if (!super.equals(o)) {
-      return false;
-    }
-    OverflowProcessor that = (OverflowProcessor) o;
-    return isMerge == that.isMerge &&
-            valueCount == that.valueCount &&
-            lastFlushTime == that.lastFlushTime &&
-            memThreshold == that.memThreshold &&
-            Objects.equals(workResource, that.workResource) &&
-            Objects.equals(mergeResource, that.mergeResource) &&
-            Objects.equals(workSupport, that.workSupport) &&
-            Objects.equals(flushSupport, that.flushSupport) &&
-            Objects.equals(flushFuture, that.flushFuture) &&
-            Objects.equals(parentPath, that.parentPath) &&
-            Objects.equals(dataPathCount, that.dataPathCount) &&
-            Objects.equals(queryFlushLock, that.queryFlushLock) &&
-            Objects.equals(overflowFlushAction, that.overflowFlushAction) &&
-            Objects.equals(filenodeFlushAction, that.filenodeFlushAction) &&
-            Objects.equals(fileSchema, that.fileSchema) &&
-            Objects.equals(memSize, that.memSize) &&
-            Objects.equals(logNode, that.logNode);
+    return this == o;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(super.hashCode(), workResource, mergeResource, 
workSupport,
-            flushSupport, flushFuture, isMerge, valueCount, parentPath, 
lastFlushTime,
-            dataPathCount, queryFlushLock, overflowFlushAction, 
filenodeFlushAction, fileSchema,
-            memThreshold, memSize, logNode, flushFuture);
+    return Objects.hash(super.hashCode());
   }
 
   /**

Reply via email to