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-validator.git


The following commit(s) were added to refs/heads/master by this push:
     new e03b76d1 Use String.isEmpty()
e03b76d1 is described below

commit e03b76d1f8a87d23e4811b2a55aab5d1cedfb565
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Oct 2 13:40:22 2022 -0400

    Use String.isEmpty()
---
 src/main/java/org/apache/commons/validator/routines/UrlValidator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/validator/routines/UrlValidator.java 
b/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
index 74b2ea5f..c038e9a6 100644
--- a/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
@@ -314,7 +314,7 @@ public class UrlValidator implements Serializable {
         }
 
         final String authority = uri.getRawAuthority();
-        if ("file".equals(scheme) && (authority == null || 
"".equals(authority))) {// Special case - file: allows an empty authority
+        if ("file".equals(scheme) && (authority == null || 
authority.isEmpty())) {// Special case - file: allows an empty authority
             return true; // this is a local file - nothing more to do here
         }
         if ("file".equals(scheme) && authority != null && 
authority.contains(":")) {

Reply via email to