zhongyujiang commented on code in PR #7133:
URL: https://github.com/apache/iceberg/pull/7133#discussion_r1142278824


##########
api/src/main/java/org/apache/iceberg/util/CharSequenceSet.java:
##########
@@ -139,16 +139,26 @@ public boolean addAll(Collection<? extends CharSequence> 
charSequences) {
   @Override
   public boolean retainAll(Collection<?> objects) {
     if (objects != null) {
-      return Iterables.removeAll(wrapperSet, objects);
+      Set<CharSequenceWrapper> toRetain =
+          objects.stream()
+              .filter(CharSequence.class::isInstance)
+              .map(CharSequence.class::cast)
+              .map(CharSequenceWrapper::wrap)
+              .collect(Collectors.toSet());
+
+      return Iterables.retainAll(wrapperSet, toRetain);
     }
+
     return false;
   }
 
   @Override
+  @SuppressWarnings("CollectionUndefinedEquality")

Review Comment:
   It complained in the previous 
[CI](https://github.com/apache/iceberg/actions/runs/4453914559/jobs/7822747581#step:4:102).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to