You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by GitBox <gi...@apache.org> on 2022/05/05 10:54:23 UTC

[GitHub] [incubator-hugegraph] imbajin commented on a diff in pull request #1856: fix equals and hashcode issue

imbajin commented on code in PR #1856:
URL: https://github.com/apache/incubator-hugegraph/pull/1856#discussion_r865782183


##########
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/TextBackendEntry.java:
##########
@@ -371,4 +372,13 @@ public boolean equals(Object obj) {
         }
         return true;
     }
+
+    // ConcurrentSkipListMap override equals();
+    // ConcurrentSkipListMap extend AbstractMap and AbstractMap implement
+    // hashCode()

Review Comment:
   useful for future? or use `/**/` for it



##########
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/BinaryBackendEntry.java:
##########
@@ -197,6 +197,11 @@ public boolean equals(Object obj) {
         return this.columns.containsAll(other.columns);
     }
 
+    public int hashCode() {
+        return this.id().hashCode() ^
+               this.columns.size();

Review Comment:
   why we separate them to 2 lines?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org