Skip to content

Commit de0e418

Browse files
committed
Option.Builder.option("") should throw IllegalArgumentException instead
of ArrayIndexOutOfBoundsException
1 parent 427d698 commit de0e418

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/test/java/org/apache/commons/cli/OptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void testBuilderInsufficientParams2() {
123123

124124
@Test
125125
public void testBuilderInvalidOptionName0() {
126-
assertNull(Option.builder().option(null));
126+
assertThrows(IllegalArgumentException.class, () -> Option.builder().option(null).build());
127127
assertThrows(IllegalArgumentException.class, () -> Option.builder().option(""));
128128
assertThrows(IllegalArgumentException.class, () -> Option.builder().option(" "));
129129
}

0 commit comments

Comments
 (0)