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 b1f2138  Use isEmpty().
b1f2138 is described below

commit b1f2138a4842870af4586db152d973d50344b4be
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Jan 17 10:34:51 2021 -0500

    Use isEmpty().
---
 .../org/apache/commons/vfs2/impl/StandardFileSystemManager.java     | 6 +++---
 .../java/org/apache/commons/vfs2/provider/AbstractFileName.java     | 4 ++--
 .../org/apache/commons/vfs2/provider/http/HttpClientFactory.java    | 2 +-
 .../org/apache/commons/vfs2/provider/http4/Http4FileProvider.java   | 2 +-
 .../org/apache/commons/vfs2/provider/http5/Http5FileProvider.java   | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
index fcb84a3..5181f34 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
@@ -268,7 +268,7 @@ public class StandardFileSystemManager extends 
DefaultFileSystemManager {
     private void addExtensionMap(final Element map) {
         final String extension = map.getAttribute("extension");
         final String scheme = map.getAttribute("scheme");
-        if (scheme != null && scheme.length() > 0) {
+        if (scheme != null && !scheme.isEmpty()) {
             addExtensionMap(extension, scheme);
         }
     }
@@ -366,7 +366,7 @@ public class StandardFileSystemManager extends 
DefaultFileSystemManager {
         for (int i = 0; i < count; i++) {
             final Element dep = (Element) deps.item(i);
             final String className = dep.getAttribute("class-name");
-            if (className != null && className.length() > 0) {
+            if (className != null && !className.isEmpty()) {
                 classes.add(className);
             }
         }
@@ -383,7 +383,7 @@ public class StandardFileSystemManager extends 
DefaultFileSystemManager {
         for (int i = 0; i < count; i++) {
             final Element dep = (Element) deps.item(i);
             final String scheme = dep.getAttribute("scheme");
-            if (scheme != null && scheme.length() > 0) {
+            if (scheme != null && !scheme.isEmpty()) {
                 schemes.add(scheme);
             }
         }
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
index bf2bf6f..43f121e 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java
@@ -58,7 +58,7 @@ public abstract class AbstractFileName implements FileName {
         this.rootUri = null;
         this.scheme = scheme;
         this.type = type;
-        if (absPath != null && absPath.length() > 0) {
+        if (absPath != null && !absPath.isEmpty()) {
             if (absPath.length() > 1 && absPath.endsWith("/")) {
                 this.absPath = absPath.substring(0, absPath.length() - 1);
             } else {
@@ -271,7 +271,7 @@ public abstract class AbstractFileName implements FileName {
     }
 
     private String handleURISpecialCharacters(String uri) {
-        if (uri != null && uri.length() > 0) {
+        if (uri != null && !uri.isEmpty()) {
             try {
                 // VFS-325: Handle URI special characters in file name
                 // Decode the base URI and re-encode with URI special 
characters
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpClientFactory.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpClientFactory.java
index fc2eb6a..807e595 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpClientFactory.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpClientFactory.java
@@ -77,7 +77,7 @@ public final class HttpClientFactory {
                 final String proxyHost = 
builder.getProxyHost(fileSystemOptions);
                 final int proxyPort = builder.getProxyPort(fileSystemOptions);
 
-                if (proxyHost != null && proxyHost.length() > 0 && proxyPort > 
0) {
+                if (proxyHost != null && !proxyHost.isEmpty() && proxyPort > 
0) {
                     config.setProxy(proxyHost, proxyPort);
                 }
 
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileProvider.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileProvider.java
index 31d2b6a..968938f 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileProvider.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileProvider.java
@@ -337,7 +337,7 @@ public class Http4FileProvider extends 
AbstractOriginatingFileProvider {
         final int proxyPort = builder.getProxyPort(fileSystemOptions);
         final String proxyScheme = builder.getProxyScheme(fileSystemOptions);
 
-        if (proxyHost != null && proxyHost.length() > 0 && proxyPort > 0) {
+        if (proxyHost != null && !proxyHost.isEmpty() && proxyPort > 0) {
             return new HttpHost(proxyHost, proxyPort, proxyScheme);
         }
 
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
index 478f2f4..87f129d 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
@@ -348,7 +348,7 @@ public class Http5FileProvider extends 
AbstractOriginatingFileProvider {
         final String proxyHost = builder.getProxyHost(fileSystemOptions);
         final int proxyPort = builder.getProxyPort(fileSystemOptions);
 
-        if (proxyHost != null && proxyHost.length() > 0 && proxyPort > 0) {
+        if (proxyHost != null && !proxyHost.isEmpty() && proxyPort > 0) {
             return new HttpHost(proxyScheme, proxyHost, proxyPort);
         }
 

Reply via email to