Skip to content

Commit 1cd16da

Browse files
committed
Use Objects.requireNonNull()
1 parent 8f94dce commit 1cd16da

File tree

1 file changed

+3
-3
lines changed
  • commons-vfs2/src/main/java/org/apache/commons/vfs2/filter

1 file changed

+3
-3
lines changed

commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/IOCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.commons.vfs2.filter;
1818

1919
import java.io.File;
20+
import java.util.Objects;
2021

2122
/**
2223
* Enumeration of IO case sensitivity.
@@ -112,9 +113,8 @@ public static IOCase forName(final String name) {
112113
* @throws NullPointerException if either string is null
113114
*/
114115
public int checkCompareTo(final String str1, final String str2) {
115-
if (str1 == null || str2 == null) {
116-
throw new NullPointerException("The strings must not be null");
117-
}
116+
Objects.requireNonNull(str1, "str1");
117+
Objects.requireNonNull(str2, "str2");
118118
return sensitive ? str1.compareTo(str2) : str1.compareToIgnoreCase(str2);
119119
}
120120

0 commit comments

Comments
 (0)