Skip to content

Commit

Permalink
Migrate toward java.util.function.Predicate
Browse files Browse the repository at this point in the history
- Maintains binary and source compatibility
  • Loading branch information
garydgregory committed Jul 10, 2024
1 parent 3618193 commit 54acc7a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down Expand Up @@ -710,7 +711,7 @@ public static <E> E first(final Iterator<E> iterator) {
* @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()) {
Expand Down

0 comments on commit 54acc7a

Please sign in to comment.