You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2025/07/29 12:36:00 UTC
[jira] [Updated] (CLI-349) DefaultParser.parse() throws NullPointerException when options parameter is null
[ https://issues.apache.org/jira/browse/CLI-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated CLI-349:
--------------------------------
Priority: Trivial (was: Major)
> 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: Trivial
> 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)