Skip to content

Commit ac6e754

Browse files
committed
Improving the order of the code - no point using a variable before it is tested
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x@748453 13f79535-47bb-0310-9956-ffa450edef68
1 parent eeb83e4 commit ac6e754

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,17 +819,17 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
819819
}
820820
sb.append(rtrim(text.substring(0, pos))).append(defaultNewLine);
821821

822-
// all following lines must be padded with nextLineTabStop space
823-
// characters
824-
final String padding = createPadding(nextLineTabStop);
825-
826822
if (nextLineTabStop >= width)
827823
{
828824
// stops infinite loop happening
829825
throw new IllegalStateException("Total width is less than the width of the argument and indent " +
830826
"- no room for the description");
831827
}
832828

829+
// all following lines must be padded with nextLineTabStop space
830+
// characters
831+
final String padding = createPadding(nextLineTabStop);
832+
833833
while (true)
834834
{
835835
text = padding + text.substring(pos).trim();

0 commit comments

Comments
 (0)