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


The following commit(s) were added to refs/heads/master by this push:
     new 948345e  Refactor null-checks.
948345e is described below

commit 948345efda88103d9fcaf75c3be121adc318ac64
Author: Gary Gregory <gardgreg...@gmail.com>
AuthorDate: Wed Sep 22 10:35:00 2021 -0400

    Refactor null-checks.
---
 .../java/org/apache/commons/io/filefilter/WildcardFileFilter.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java 
b/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
index 62896b6..6ad91d8 100644
--- a/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
@@ -138,9 +138,7 @@ public class WildcardFileFilter extends AbstractFileFilter 
implements Serializab
      * @throws IllegalArgumentException if the pattern is null
      */
     public WildcardFileFilter(final String wildcard, final IOCase ioCase) {
-        if (wildcard == null) {
-            throw new IllegalArgumentException("The wildcard must not be 
null");
-        }
+        requireNonNull(wildcard, "wildcard");
         this.wildcards = new String[] { wildcard };
         this.ioCase = IOCase.value(ioCase, IOCase.SENSITIVE);
     }
@@ -153,9 +151,7 @@ public class WildcardFileFilter extends AbstractFileFilter 
implements Serializab
      * @throws IllegalArgumentException if the pattern array is null
      */
     public WildcardFileFilter(final String[] wildcards, final IOCase ioCase) {
-        if (wildcards == null) {
-            throw new IllegalArgumentException("The wildcard array must not be 
null");
-        }
+        requireNonNull(wildcards, "wildcards");
         this.wildcards = wildcards.clone();
         this.ioCase = IOCase.value(ioCase, IOCase.SENSITIVE);
     }

Reply via email to