From 54acc7a5d7151918f3dc1bfa1dd5f7dda3752342 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 10 Jul 2024 11:01:38 -0400 Subject: [PATCH] Migrate toward java.util.function.Predicate - Maintains binary and source compatibility --- .../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 void forEach(final Iterator iterator, final Closure closure) { + public static void forEach(final Iterator iterator, final Consumer closure) { Objects.requireNonNull(closure, "closure"); if (iterator != null) { while (iterator.hasNext()) {