Author: bayard
Date: Fri Feb 27 09:18:38 2009
New Revision: 748453
URL: http://svn.apache.org/viewvc?rev=748453&view=rev
Log:
Improving the order of the code - no point using a variable before it is tested
Modified:
commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java
Modified:
commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java
URL:
http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java?rev=748453&r1=748452&r2=748453&view=diff
==============================================================================
---
commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java
(original)
+++
commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java
Fri Feb 27 09:18:38 2009
@@ -819,10 +819,6 @@
}
sb.append(rtrim(text.substring(0, pos))).append(defaultNewLine);
- // all following lines must be padded with nextLineTabStop space
- // characters
- final String padding = createPadding(nextLineTabStop);
-
if (nextLineTabStop >= width)
{
// stops infinite loop happening
@@ -830,6 +826,10 @@
"- no room for the description");
}
+ // all following lines must be padded with nextLineTabStop space
+ // characters
+ final String padding = createPadding(nextLineTabStop);
+
while (true)
{
text = padding + text.substring(pos).trim();