Leo Fernandes created CLI-349:
---------------------------------
Summary: DefaultParser.parse() throws NullPointerException when
options parameter is null
Key: CLI-349
URL: https://issues.apache.org/jira/browse/CLI-349
Project: Commons CLI
Issue Type: Bug
Components: Options definition, Parser
Affects Versions: 1.9.0
Reporter: Leo Fernandes
The DefaultParser.parse() method throws a NullPointerException when the options
parameter is null.
Steps to reproduce:
1. Create a DefaultParser instance
2. Call parse() with null options parameter: Eg.:
{code:java}
defaultParser0.parse((Options) null, stringArray0, getBooleanJazzer());{code}
3. NPE is thrown at line DefaultParser.java:708:
{code:java}
expectedOpts = new ArrayList<>(options.getRequiredOptions());{code}
Expected behavior: The method should validate input parameters and throw a
meaningful IllegalArgumentException with a descriptive message.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)