nastra commented on code in PR #7133:
URL: https://github.com/apache/iceberg/pull/7133#discussion_r1142151735
##########
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:
is this one necessary? I don't see errorprone complaining about it
--
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]