You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/27 15:52:37 UTC

[commons-io] branch master updated: Use stock JRE null checking Objects.requireNonNull().

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 d0cd953  Use stock JRE null checking Objects.requireNonNull().
d0cd953 is described below

commit d0cd953c69a39bc2605ac08dbce8b39e084f4ef0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Sep 27 11:52:33 2020 -0400

    Use stock JRE null checking Objects.requireNonNull().
---
 src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
index 3a76d2e..ea7b8c7 100644
--- a/src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
@@ -18,6 +18,7 @@ package org.apache.commons.io.filefilter;
 
 import java.io.File;
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * This filter produces a logical NOT of the filters specified.
@@ -36,13 +37,10 @@ public class NotFileFilter extends AbstractFileFilter implements Serializable {
      * Constructs a new file filter that NOTs the result of another filter.
      *
      * @param filter the filter, must not be null
-     * @throws IllegalArgumentException if the filter is null
+     * @throws NullPointerException if the filter is null
      */
     public NotFileFilter(final IOFileFilter filter) {
-        if (filter == null) {
-            throw new IllegalArgumentException("The filter must not be null");
-        }
-        this.filter = filter;
+        this.filter = Objects.requireNonNull(filter, "filter");
     }
 
     /**