aokolnychyi commented on code in PR #9245:
URL: https://github.com/apache/iceberg/pull/9245#discussion_r1419844796


##########
api/src/main/java/org/apache/iceberg/util/CharSequenceSet.java:
##########
@@ -168,22 +167,29 @@ public void clear() {
   }
 
   @Override
-  public boolean equals(Object o) {
-    if (this == o) {
+  public boolean equals(Object other) {
+    if (this == other) {
       return true;
+    } else if (!(other instanceof Set)) {
+      return false;
     }
 
-    if (o == null || getClass() != o.getClass()) {
+    Set<?> that = (Set<?>) other;
+
+    if (size() != that.size()) {
       return false;
     }
 
-    CharSequenceSet that = (CharSequenceSet) o;
-    return wrapperSet.equals(that.wrapperSet);
+    try {
+      return containsAll(that);
+    } catch (ClassCastException | NullPointerException unused) {

Review Comment:
   While this class does not throw these exceptions now, it may in the future. 
These exceptions are valid outcomes defined by the `Set` API. Therefore, I am 
respecting that to be safe.



-- 
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-unsubscr...@iceberg.apache.org

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


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

Reply via email to