Skip to content
Permalink
Browse files
PMD: Useless parenthesis
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@1677402 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
britter committed May 3, 2015
1 parent 3382d16 commit 6b87d290954c4594fc69a3a0b85fff12490cfde5
Showing 4 changed files with 10 additions and 10 deletions.
@@ -675,7 +675,7 @@ protected void handleConcatenatedOptions(String token) throws ParseException
{
handleOption(options.getOption(ch));

if (currentOption != null && (token.length() != (i + 1)))
if (currentOption != null && token.length() != i + 1)
{
// add the trail as an argument of the option
currentOption.addValueForProcessing(token.substring(i + 1));
@@ -537,7 +537,7 @@ public void printHelp(PrintWriter pw, int width, String cmdLineSyntax,
String header, Options options, int leftPad,
int descPad, String footer, boolean autoUsage)
{
if ((cmdLineSyntax == null) || (cmdLineSyntax.length() == 0))
if (cmdLineSyntax == null || cmdLineSyntax.length() == 0)
{
throw new IllegalArgumentException("cmdLineSyntax not provided");
}
@@ -551,14 +551,14 @@ public void printHelp(PrintWriter pw, int width, String cmdLineSyntax,
printUsage(pw, width, cmdLineSyntax);
}

if ((header != null) && (header.trim().length() > 0))
if (header != null && header.trim().length() > 0)
{
printWrapped(pw, width, header);
}

printOptions(pw, width, options, leftPad, descPad);

if ((footer != null) && (footer.trim().length() > 0))
if (footer != null && footer.trim().length() > 0)
{
printWrapped(pw, width, footer);
}
@@ -837,7 +837,7 @@ protected StringBuffer renderOptions(StringBuffer sb, int width, Options options
}

prefixList.add(optBuf);
max = (optBuf.length() > max) ? optBuf.length() : max;
max = optBuf.length() > max ? optBuf.length() : max;
}

int x = 0;
@@ -917,7 +917,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
return sb;
}

if ((text.length() > width) && (pos == nextLineTabStop - 1))
if (text.length() > width && pos == nextLineTabStop - 1)
{
pos = width;
}
@@ -1043,14 +1043,14 @@ protected String createPadding(int len)
*/
protected String rtrim(String s)
{
if ((s == null) || (s.length() == 0))
if (s == null || s.length() == 0)
{
return s;
}

int pos = s.length();

while ((pos > 0) && Character.isWhitespace(s.charAt(pos - 1)))
while (pos > 0 && Character.isWhitespace(s.charAt(pos - 1)))
{
--pos;
}
@@ -463,7 +463,7 @@ private void processValue(String value)
while (index != -1)
{
// next value to be added
if (values.size() == (numberOfArgs - 1))
if (values.size() == numberOfArgs - 1)
{
break;
}
@@ -276,7 +276,7 @@ protected void burstToken(String token, boolean stopAtNonOption)
tokens.add("-" + ch);
currentOption = options.getOption(ch);

if (currentOption.hasArg() && (token.length() != (i + 1)))
if (currentOption.hasArg() && token.length() != i + 1)
{
tokens.add(token.substring(i + 1));

0 comments on commit 6b87d29

Please sign in to comment.