MyXOF commented on a change in pull request #32: fix sonar issues
URL: https://github.com/apache/incubator-iotdb/pull/32#discussion_r251705965
 
 

 ##########
 File path: 
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/IntervalFileNode.java
 ##########
 @@ -227,51 +230,33 @@ public int hashCode() {
   }
 
   @Override
-  public boolean equals(Object obj) {
-
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
-      return false;
-    }
-    IntervalFileNode other = (IntervalFileNode) obj;
-    if (endTimeMap == null) {
-      if (other.endTimeMap != null) {
-        return false;
-      }
-    } else if (!endTimeMap.equals(other.endTimeMap)) {
-      return false;
-    }
-    if (relativePath == null) {
-      if (other.relativePath != null) {
-        return false;
-      }
-    } else if (!relativePath.equals(other.relativePath)) {
-      return false;
-    }
-    if (overflowChangeType != other.overflowChangeType) {
-      return false;
-    }
-    if (startTimeMap == null) {
-      if (other.startTimeMap != null) {
-        return false;
-      }
-    } else if (!startTimeMap.equals(other.startTimeMap)) {
-      return false;
-    }
-    return true;
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    IntervalFileNode fileNode = (IntervalFileNode) o;
+    return baseDirIndex == fileNode.baseDirIndex &&
+            overflowChangeType == fileNode.overflowChangeType &&
+            Objects.equals(relativePath, fileNode.relativePath) &&
+            Objects.equals(startTimeMap, fileNode.startTimeMap) &&
 
 Review comment:
   两个map可以用Object.equals判断相等?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to