Skip to content

Commit 948345e

Browse files
author
Gary Gregory
committed
Refactor null-checks.
1 parent 547e8c9 commit 948345e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ public WildcardFileFilter(final String... wildcards) {
138138
* @throws IllegalArgumentException if the pattern is null
139139
*/
140140
public WildcardFileFilter(final String wildcard, final IOCase ioCase) {
141-
if (wildcard == null) {
142-
throw new IllegalArgumentException("The wildcard must not be null");
143-
}
141+
requireNonNull(wildcard, "wildcard");
144142
this.wildcards = new String[] { wildcard };
145143
this.ioCase = IOCase.value(ioCase, IOCase.SENSITIVE);
146144
}
@@ -153,9 +151,7 @@ public WildcardFileFilter(final String wildcard, final IOCase ioCase) {
153151
* @throws IllegalArgumentException if the pattern array is null
154152
*/
155153
public WildcardFileFilter(final String[] wildcards, final IOCase ioCase) {
156-
if (wildcards == null) {
157-
throw new IllegalArgumentException("The wildcard array must not be null");
158-
}
154+
requireNonNull(wildcards, "wildcards");
159155
this.wildcards = wildcards.clone();
160156
this.ioCase = IOCase.value(ioCase, IOCase.SENSITIVE);
161157
}

0 commit comments

Comments
 (0)