Skip to content

Commit 4381ba5

Browse files
committed
Ensure the consistency of the fields initial values in OptionBuilder before and after the creation of an option (fixes CLI-186)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@956302 13f79535-47bb-0310-9956-ffa450edef68
1 parent 324b7f9 commit 4381ba5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/org/apache/commons/cli/OptionBuilder.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public final class OptionBuilder
5757
/** option builder instance */
5858
private static OptionBuilder instance = new OptionBuilder();
5959

60+
static
61+
{
62+
// ensure the consistency of the initial values
63+
reset();
64+
}
65+
6066
/**
6167
* private constructor to prevent instances being created
6268
*/
@@ -76,9 +82,6 @@ private static void reset()
7682
type = null;
7783
required = false;
7884
numberOfArgs = Option.UNINITIALIZED;
79-
80-
81-
// PMM 9/6/02 - these were missing
8285
optionalArg = false;
8386
valuesep = (char) 0;
8487
}

0 commit comments

Comments
 (0)