You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/07/10 15:01:54 UTC
(commons-collections) 01/01: Migrate toward java.util.function.Predicate
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch japicmp_false_positive
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 54acc7a5d7151918f3dc1bfa1dd5f7dda3752342
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Jul 10 11:01:38 2024 -0400
Migrate toward java.util.function.Predicate
- Maintains binary and source compatibility
---
src/main/java/org/apache/commons/collections4/IteratorUtils.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index 856c4b857..b237316ab 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Objects;
+import java.util.function.Consumer;
import org.apache.commons.collections4.functors.EqualPredicate;
import org.apache.commons.collections4.iterators.ArrayIterator;
@@ -710,7 +711,7 @@ public class IteratorUtils {
* @throws NullPointerException if closure is null
* @since 4.1
*/
- public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) {
+ public static <E> void forEach(final Iterator<E> iterator, final Consumer<? super E> closure) {
Objects.requireNonNull(closure, "closure");
if (iterator != null) {
while (iterator.hasNext()) {