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


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

commit 611118338bd16ea706cc126beacf2ff0e94f3188
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jan 17 09:10:05 2021 -0500

    Use isEmpty().
---
 src/main/java/org/apache/commons/exec/CommandLine.java      | 6 +++---
 src/main/java/org/apache/commons/exec/util/StringUtils.java | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/exec/CommandLine.java 
b/src/main/java/org/apache/commons/exec/CommandLine.java
index 5a1882c..fad7e3d 100644
--- a/src/main/java/org/apache/commons/exec/CommandLine.java
+++ b/src/main/java/org/apache/commons/exec/CommandLine.java
@@ -78,7 +78,7 @@ public class CommandLine {
                 
         if (line == null) {
             throw new IllegalArgumentException("Command line can not be null");
-        } else if (line.trim().length() == 0) {
+        } else if (line.trim().isEmpty()) {
             throw new IllegalArgumentException("Command line can not be 
empty");
         } else {
             final String[] tmp = translateCommandline(line);
@@ -334,7 +334,7 @@ public class CommandLine {
      *         parameter results in a zero sized array
      */
     private static String[] translateCommandline(final String toProcess) {
-        if (toProcess == null || toProcess.length() == 0) {
+        if (toProcess == null || toProcess.isEmpty()) {
             // no command? no string
             return new String[0];
         }
@@ -410,7 +410,7 @@ public class CommandLine {
     private String toCleanExecutable(final String dirtyExecutable) {
         if (dirtyExecutable == null) {
             throw new IllegalArgumentException("Executable can not be null");
-        } else if (dirtyExecutable.trim().length() == 0) {
+        } else if (dirtyExecutable.trim().isEmpty()) {
             throw new IllegalArgumentException("Executable can not be empty");
         } else {
             return StringUtils.fixFileSeparatorChar(dirtyExecutable);
diff --git a/src/main/java/org/apache/commons/exec/util/StringUtils.java 
b/src/main/java/org/apache/commons/exec/util/StringUtils.java
index b8fb1e9..c2e2a68 100644
--- a/src/main/java/org/apache/commons/exec/util/StringUtils.java
+++ b/src/main/java/org/apache/commons/exec/util/StringUtils.java
@@ -70,7 +70,7 @@ public class StringUtils {
 
         final StringBuffer argBuf = new StringBuffer();
 
-        if (argStr == null || argStr.length() == 0) {
+        if (argStr == null || argStr.isEmpty()) {
             return argBuf;
         }
 

Reply via email to