Author: ebourg
Date: Sat Jun 19 22:01:51 2010
New Revision: 956302

URL: http://svn.apache.org/viewvc?rev=956302&view=rev
Log:
Ensure the consistency of the fields initial values in OptionBuilder before and 
after the creation of an option (fixes CLI-186)

Modified:
    
commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java

Modified: 
commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java
URL: 
http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java?rev=956302&r1=956301&r2=956302&view=diff
==============================================================================
--- 
commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java
 (original)
+++ 
commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java
 Sat Jun 19 22:01:51 2010
@@ -57,6 +57,12 @@ public final class OptionBuilder
     /** option builder instance */
     private static OptionBuilder instance = new OptionBuilder();
 
+    static
+    {
+        // ensure the consistency of the initial values
+        reset();
+    }
+
     /**
      * private constructor to prevent instances being created
      */
@@ -76,9 +82,6 @@ public final class OptionBuilder
         type = null;
         required = false;
         numberOfArgs = Option.UNINITIALIZED;
-
-
-        // PMM 9/6/02 - these were missing
         optionalArg = false;
         valuesep = (char) 0;
     }


Reply via email to