File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
commons-vfs2/src/main/java/org/apache/commons/vfs2/filter Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 17
17
package org .apache .commons .vfs2 .filter ;
18
18
19
19
import java .io .File ;
20
+ import java .util .Objects ;
20
21
21
22
/**
22
23
* Enumeration of IO case sensitivity.
@@ -112,9 +113,8 @@ public static IOCase forName(final String name) {
112
113
* @throws NullPointerException if either string is null
113
114
*/
114
115
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" );
118
118
return sensitive ? str1 .compareTo (str2 ) : str1 .compareToIgnoreCase (str2 );
119
119
}
120
120
You can’t perform that action at this time.
0 commit comments