Description
- First at all, your testAmbiguousLongWithoutEqualSingleDash does not lead to a AmbiguousOptionException
- For this same test, if I replace the deprecated OptionBuilder with Option.Builder as follows
options.addOption(Option.builder().option("f").longOpt("foo").optionalArg(true).build()); options.addOption(Option.builder().option("b").longOpt("bar").optionalArg(false).build());
the test leads to a NPE
java.lang.NullPointerException at xx.DefaultParser.handleShortAndLongOption(DefaultParser.java:476) at xx.DefaultParser.handleToken(DefaultParser.java:535) at xx.DefaultParser.parse(DefaultParser.java:714) at xx.DefaultParser.parse(DefaultParser.java:677) at xx.DefaultParser.parse(DefaultParser.java:654)
Note : tested with Github code (January 22, 2023)