Skip to content

Commit 6e9aaf2

Browse files
author
Robert James Oxspring
committed
ArgumentBuilder now resets the validator to null on reset()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@130093 13f79535-47bb-0310-9956-ffa450edef68
1 parent 667f17a commit 6e9aaf2

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/java/org/apache/commons/cli2/builder/ArgumentBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public final void reset() {
100100
maximum = Integer.MAX_VALUE;
101101
initialSeparator = ArgumentImpl.DEFAULT_INITIAL_SEPARATOR;
102102
subsequentSeparator = ArgumentImpl.DEFAULT_SUBSEQUENT_SEPARATOR;
103+
validator = null;
103104
consumeRemaining = "--";
104105
defaultValues = null;
105106
id = 0;

src/test/org/apache/commons/cli2/option/ArgumentTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ public void testProcessValues_ContractedTooFew() throws OptionException {
319319
final ListIterator iterator = args.listIterator();
320320
try {
321321
option.processValues(commandLine, iterator, option);
322+
option.validate(commandLine);
322323
fail("Expected MissingValueException");
323324
}
324325
catch (OptionException mve) {
@@ -549,6 +550,7 @@ public void testProcess_ConsumeNothing() throws OptionException {
549550

550551
try {
551552
option.process(commandLine, iterator);
553+
option.validate(commandLine);
552554
fail("Missing Value!");
553555
}
554556
catch (OptionException mve) {

0 commit comments

Comments
 (0)