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-functor.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ce041d  Use Objects.requireNonNull()
0ce041d is described below

commit 0ce041d20a3f8355b3903ae65f99d9843697743f
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Dec 26 14:07:45 2024 -0500

    Use Objects.requireNonNull()
---
 .../org/apache/commons/functor/core/collection/FilteredIterable.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/core/src/main/java/org/apache/commons/functor/core/collection/FilteredIterable.java
 
b/core/src/main/java/org/apache/commons/functor/core/collection/FilteredIterable.java
index ad22fee..64f58a8 100644
--- 
a/core/src/main/java/org/apache/commons/functor/core/collection/FilteredIterable.java
+++ 
b/core/src/main/java/org/apache/commons/functor/core/collection/FilteredIterable.java
@@ -18,6 +18,7 @@ package org.apache.commons.functor.core.collection;
 
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.Objects;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Predicate;
@@ -104,9 +105,7 @@ public class FilteredIterable<T> implements Iterable<T> {
      * @return <code>this</code>, fluently
      */
     public FilteredIterable<T> retain(Predicate<? super T> filter) {
-        if (filter == null) {
-            throw new NullPointerException("filtering predicate was null");
-        }
+        Objects.requireNonNull(filter, "filtering predicate was null");
         synchronized (this) {
             if (this.predicate == null) {
                 this.predicate = new And<T>();

Reply via email to