This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit 71a3d088c4868c0c88f62bd12ea20c8f53933cb1
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Jul 9 22:21:18 2024 -0400

    [Functional] FunctorUtils.validate(Closure...) is now
    FunctorUtils.validate(Consumer...)
---
 src/changes/changes.xml                                     |  1 +
 .../apache/commons/collections4/functors/FunctorUtils.java  | 13 +++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3b31de300..c9817bcc6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,6 +30,7 @@
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Add missing 
Javadocs.</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">PatriciaTrie 
constructor reuse the stateless singleton StringKeyAnalyzer.INSTANCE.</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate 
StringKeyAnalyzer.StringKeyAnalyzer() in favor of 
StringKeyAnalyzer.INSTANCE.</action>
+    <action type="fix" dev="ggregory" due-to="Gary Gregory">[Functional] 
FunctorUtils.validate(Closure...) is now 
FunctorUtils.validate(Consumer...).</action>
     <!-- ADD -->
     <!-- UPDATE -->
     <action issue="COLLECTIONS-857" type="update" dev="ggregory" 
due-to="Claude Warren">Update bloom filter documentation #508.</action>
diff --git 
a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java 
b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
index 163ba4101..9f970cd1f 100644
--- a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java
@@ -18,6 +18,7 @@ package org.apache.commons.collections4.functors;
 
 import java.util.Collection;
 import java.util.Objects;
+import java.util.function.Consumer;
 
 import org.apache.commons.collections4.Closure;
 import org.apache.commons.collections4.Predicate;
@@ -123,14 +124,14 @@ final class FunctorUtils {
     }
 
     /**
-     * Validate the closures to ensure that all is well.
+     * Validates the consumers to ensure that all is well.
      *
-     * @param closures  the closures to validate
+     * @param consumers  the consumers to validate.
      */
-    static void validate(final Closure<?>... closures) {
-        Objects.requireNonNull(closures, "closures");
-        for (int i = 0; i < closures.length; i++) {
-            if (closures[i] == null) {
+    static void validate(final Consumer<?>... consumers) {
+        Objects.requireNonNull(consumers, "closures");
+        for (int i = 0; i < consumers.length; i++) {
+            if (consumers[i] == null) {
                 throw new NullPointerException("closures[" + i + "]");
             }
         }

Reply via email to