gnodet-bot commented on code in PR #28643:
URL: https://github.com/apache/camel/pull/28643#discussion_r4407873502


##########
core/camel-util/src/main/java/org/apache/camel/util/FilterIterator.java:
##########
@@ -31,6 +31,8 @@ public class FilterIterator<T> implements Iterator<T>, 
Closeable {
     private final Predicate<T> filter;
     private T next;
     private boolean closed;
+    // true while the last element returned by next() is the last element 
taken from the underlying iterator
+    private boolean canRemove;

Review Comment:
   💡 **Nit:** The comment describes the field in terms of the underlying 
iterator's internal position, which isn't the invariant that matters here. The 
actual purpose of the field is to guard `remove()` calls.
   
   Suggested rewording:
   
   ```suggestion
       // true if remove() may be called to remove the element last returned by 
next()
       private boolean canRemove;
   ```



-- 
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]

Reply via email to