You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2023/12/01 05:55:35 UTC

Re: [PR] Core: Implement equals/hashCode method for RESTResponse [iceberg]

Fokko commented on code in PR #9049:
URL: https://github.com/apache/iceberg/pull/9049#discussion_r1411644693


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -846,6 +846,92 @@ private static Map<String, SnapshotRef> validateRefs(
     return inputRefs;
   }
 
+  @Override
+  @SuppressWarnings("CyclomaticComplexity")
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    TableMetadata that = (TableMetadata) o;
+    return formatVersion == that.formatVersion

Review Comment:
   @nastra is more the Javaista here, what are your thoughts here? This does not seem to be very maintainable.



##########
api/src/main/java/org/apache/iceberg/Schema.java:
##########
@@ -507,4 +508,25 @@ public String toString() {
                 .map(this::identifierFieldToString)
                 .collect(Collectors.toList())));
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {

Review Comment:
   More on the style, I think this is easier to read:
   ```suggestion
       if (o instanceof Schema) {
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org