Use stock JRE null checking Objects.requireNonNull().
MODIFY
src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
import java.io.File;
import java.io.Serializable;
+import java.util.Objects;
/**
* This filter produces a logical NOT of the filters specified.
* 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");
}
/**

Use stock JRE null checking Objects.requireNonNull().