This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 1cd16dacb Use Objects.requireNonNull()
1cd16dacb is described below

commit 1cd16dacb7bea7985c7574c42858f830ad52895b
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Dec 26 14:34:05 2024 -0500

    Use Objects.requireNonNull()
---
 .../src/main/java/org/apache/commons/vfs2/filter/IOCase.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/IOCase.java 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/IOCase.java
index 8a2fef1cd..b677ae6da 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/IOCase.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/IOCase.java
@@ -17,6 +17,7 @@
 package org.apache.commons.vfs2.filter;
 
 import java.io.File;
+import java.util.Objects;
 
 /**
  * Enumeration of IO case sensitivity.
@@ -112,9 +113,8 @@ public enum IOCase {
      * @throws NullPointerException if either string is null
      */
     public int checkCompareTo(final String str1, final String str2) {
-        if (str1 == null || str2 == null) {
-            throw new NullPointerException("The strings must not be null");
-        }
+        Objects.requireNonNull(str1, "str1");
+        Objects.requireNonNull(str2, "str2");
         return sensitive ? str1.compareTo(str2) : 
str1.compareToIgnoreCase(str2);
     }
 

Reply via email to