[
https://issues.apache.org/jira/browse/CLI-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved CLI-349.
---------------------------------
Fix Version/s: 1.10.0
Resolution: Fixed
> 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
> Priority: Major
> Labels: NPE, NullPointerException
> Fix For: 1.10.0
>
>
> 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)