Skip to content

Commit d0cd953

Browse files
author
Gary Gregory
committed
Use stock JRE null checking Objects.requireNonNull().
1 parent d071db7 commit d0cd953

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.File;
2020
import java.io.Serializable;
21+
import java.util.Objects;
2122

2223
/**
2324
* This filter produces a logical NOT of the filters specified.
@@ -36,13 +37,10 @@ public class NotFileFilter extends AbstractFileFilter implements Serializable {
3637
* Constructs a new file filter that NOTs the result of another filter.
3738
*
3839
* @param filter the filter, must not be null
39-
* @throws IllegalArgumentException if the filter is null
40+
* @throws NullPointerException if the filter is null
4041
*/
4142
public NotFileFilter(final IOFileFilter filter) {
42-
if (filter == null) {
43-
throw new IllegalArgumentException("The filter must not be null");
44-
}
45-
this.filter = filter;
43+
this.filter = Objects.requireNonNull(filter, "filter");
4644
}
4745

4846
/**

0 commit comments

Comments
 (0)