Skip to content

Commit af54c01

Browse files
committed
Use isEmpty().
1 parent 480802d commit af54c01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/apache/commons/cli/HelpFormatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public void printHelp(final PrintWriter pw, final int width, final String cmdLin
539539
final String header, final Options options, final int leftPad,
540540
final int descPad, final String footer, final boolean autoUsage)
541541
{
542-
if (cmdLineSyntax == null || cmdLineSyntax.length() == 0)
542+
if (cmdLineSyntax == null || cmdLineSyntax.isEmpty())
543543
{
544544
throw new IllegalArgumentException("cmdLineSyntax not provided");
545545
}
@@ -826,7 +826,7 @@ protected StringBuffer renderOptions(final StringBuffer sb, final int width, fin
826826
if (option.hasArg())
827827
{
828828
final String argName = option.getArgName();
829-
if (argName != null && argName.length() == 0)
829+
if (argName != null && argName.isEmpty())
830830
{
831831
// if the option has a blank argname
832832
optBuf.append(' ');
@@ -1045,7 +1045,7 @@ protected String createPadding(final int len)
10451045
*/
10461046
protected String rtrim(final String s)
10471047
{
1048-
if (s == null || s.length() == 0)
1048+
if (s == null || s.isEmpty())
10491049
{
10501050
return s;
10511051
}

0 commit comments

Comments
 (0)