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


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

commit af54c01799ebf3ed613bfd9cc9e4934676b245fd
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jan 17 09:04:29 2021 -0500

    Use isEmpty().
---
 src/main/java/org/apache/commons/cli/HelpFormatter.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/cli/HelpFormatter.java 
b/src/main/java/org/apache/commons/cli/HelpFormatter.java
index 981ca5c..4e6fbcf 100644
--- a/src/main/java/org/apache/commons/cli/HelpFormatter.java
+++ b/src/main/java/org/apache/commons/cli/HelpFormatter.java
@@ -539,7 +539,7 @@ public class HelpFormatter
                           final String header, final Options options, final 
int leftPad,
                           final int descPad, final String footer, final 
boolean autoUsage)
     {
-        if (cmdLineSyntax == null || cmdLineSyntax.length() == 0)
+        if (cmdLineSyntax == null || cmdLineSyntax.isEmpty())
         {
             throw new IllegalArgumentException("cmdLineSyntax not provided");
         }
@@ -826,7 +826,7 @@ public class HelpFormatter
             if (option.hasArg())
             {
                 final String argName = option.getArgName();
-                if (argName != null && argName.length() == 0)
+                if (argName != null && argName.isEmpty())
                 {
                     // if the option has a blank argname
                     optBuf.append(' ');
@@ -1045,7 +1045,7 @@ public class HelpFormatter
      */
     protected String rtrim(final String s)
     {
-        if (s == null || s.length() == 0)
+        if (s == null || s.isEmpty())
         {
             return s;
         }

Reply via email to