Skip to content

Commit c1b7d4c

Browse files
committed
Make JDK 1.4 compatible again.
Fix spelling. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x@751120 13f79535-47bb-0310-9956-ffa450edef68
1 parent fba4aa3 commit c1b7d4c

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class HelpFormatter
4848
*/
4949
public static final int DEFAULT_DESC_PAD = 3;
5050

51-
/** the string to display at the begining of the usage statement */
51+
/** the string to display at the beginning of the usage statement */
5252
public static final String DEFAULT_SYNTAX_PREFIX = "usage: ";
5353

5454
/** default prefix for shortOpts */
@@ -388,7 +388,7 @@ public void printHelp(String cmdLineSyntax, String header, Options options, Stri
388388
*
389389
* @param width the number of characters to be displayed on each line
390390
* @param cmdLineSyntax the syntax for this application
391-
* @param header the banner to display at the begining of the help
391+
* @param header the banner to display at the beginning of the help
392392
* @param options the Options instance
393393
* @param footer the banner to display at the end of the help
394394
*/

src/test/org/apache/commons/cli/HelpFormatterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void testFindWrapPos() throws Exception
4040
HelpFormatter hf = new HelpFormatter();
4141

4242
String text = "This is a test.";
43-
//text width should be max 8; the wrap postition is 7
43+
//text width should be max 8; the wrap position is 7
4444
assertEquals("wrap position", 7, hf.findWrapPos(text, 8, 0));
4545
//starting from 8 must give -1 - the wrap pos is after end
4646
assertEquals("wrap position 2", -1, hf.findWrapPos(text, 8, 8));

src/test/org/apache/commons/cli/OptionGroupTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,17 @@ public void testToString()
201201
group1.addOption(new Option(null, "foo", false, "Foo"));
202202
group1.addOption(new Option(null, "bar", false, "Bar"));
203203

204-
assertEquals("[--foo Foo, --bar Bar]".length(), group1.toString().length());
205-
assertTrue(group1.toString().contains("--foo Foo"));
206-
assertTrue(group1.toString().contains("--bar Bar"));
204+
if (!"[--bar Bar, --foo Foo]".equals(group1.toString())) {
205+
assertEquals("[--foo Foo, --bar Bar]", group1.toString());
206+
}
207207

208208
OptionGroup group2 = new OptionGroup();
209209
group2.addOption(new Option("f", "foo", false, "Foo"));
210210
group2.addOption(new Option("b", "bar", false, "Bar"));
211211

212-
assertEquals("[-f Foo, -b Bar]".length(), group2.toString().length());
213-
assertTrue(group2.toString().contains("-f Foo"));
214-
assertTrue(group2.toString().contains("-b Bar"));
212+
if (!"[-b Bar, -f Foo]".equals(group2.toString())) {
213+
assertEquals("[-f Foo, -b Bar]", group2.toString());
214+
}
215215
}
216216

217217
public void testGetNames()

0 commit comments

Comments
 (0)