You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jo...@apache.org on 2009/03/06 23:45:57 UTC

svn commit: r751120 - in /commons/proper/cli/branches/cli-1.x: ./ src/java/org/apache/commons/cli/HelpFormatter.java src/test/org/apache/commons/cli/HelpFormatterTest.java src/test/org/apache/commons/cli/OptionGroupTest.java

Author: joehni
Date: Fri Mar  6 22:45:57 2009
New Revision: 751120

URL: http://svn.apache.org/viewvc?rev=751120&view=rev
Log:
Make JDK 1.4 compatible again.
Fix spelling.

Modified:
    commons/proper/cli/branches/cli-1.x/   (props changed)
    commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/HelpFormatter.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java

Propchange: commons/proper/cli/branches/cli-1.x/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Mar  6 22:45:57 2009
@@ -1,8 +1,7 @@
+.*
 build.properties
 dist
 target
 velocity.log
-.project
 maven.log
-.classpath
 jcoverage.ser

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=751120&r1=751119&r2=751120&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 Mar  6 22:45:57 2009
@@ -48,7 +48,7 @@
      */
     public static final int DEFAULT_DESC_PAD = 3;
 
-    /** the string to display at the begining of the usage statement */
+    /** the string to display at the beginning of the usage statement */
     public static final String DEFAULT_SYNTAX_PREFIX = "usage: ";
 
     /** default prefix for shortOpts */
@@ -388,7 +388,7 @@
      *
      * @param width the number of characters to be displayed on each line
      * @param cmdLineSyntax the syntax for this application
-     * @param header the banner to display at the begining of the help
+     * @param header the banner to display at the beginning of the help
      * @param options the Options instance
      * @param footer the banner to display at the end of the help
      */

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java?rev=751120&r1=751119&r2=751120&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java Fri Mar  6 22:45:57 2009
@@ -40,7 +40,7 @@
         HelpFormatter hf = new HelpFormatter();
 
         String text = "This is a test.";
-        //text width should be max 8; the wrap postition is 7
+        //text width should be max 8; the wrap position is 7
         assertEquals("wrap position", 7, hf.findWrapPos(text, 8, 0));
         //starting from 8 must give -1 - the wrap pos is after end
         assertEquals("wrap position 2", -1, hf.findWrapPos(text, 8, 8));

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java?rev=751120&r1=751119&r2=751120&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java Fri Mar  6 22:45:57 2009
@@ -201,17 +201,17 @@
         group1.addOption(new Option(null, "foo", false, "Foo"));
         group1.addOption(new Option(null, "bar", false, "Bar"));
 
-        assertEquals("[--foo Foo, --bar Bar]".length(), group1.toString().length());
-        assertTrue(group1.toString().contains("--foo Foo"));
-        assertTrue(group1.toString().contains("--bar Bar"));
+        if (!"[--bar Bar, --foo Foo]".equals(group1.toString())) {
+            assertEquals("[--foo Foo, --bar Bar]", group1.toString());
+        }
 
         OptionGroup group2 = new OptionGroup();
         group2.addOption(new Option("f", "foo", false, "Foo"));
         group2.addOption(new Option("b", "bar", false, "Bar"));
 
-        assertEquals("[-f Foo, -b Bar]".length(), group2.toString().length());
-        assertTrue(group2.toString().contains("-f Foo"));
-        assertTrue(group2.toString().contains("-b Bar"));
+        if (!"[-b Bar, -f Foo]".equals(group2.toString())) {
+            assertEquals("[-f Foo, -b Bar]", group2.toString());
+        }
     }
 
     public void testGetNames()