commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r956302 - /commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java
Date Sat, 19 Jun 2010 22:01:52 GMT
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;
     }



Mime
View raw message