[
https://issues.apache.org/jira/browse/CLI-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Neidhart resolved CLI-241.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.3
Clarified the javadoc of the method in r1544819.
The validation is used by the OptionBuilder where the short option may be null.
> OptionValidator Implementation Does Not Agree With JavaDoc
> ----------------------------------------------------------
>
> Key: CLI-241
> URL: https://issues.apache.org/jira/browse/CLI-241
> Project: Commons CLI
> Issue Type: Bug
> Components: Validation
> Affects Versions: 1.2
> Reporter: BELUGA BEHR
> Fix For: 1.3
>
>
> OptionValidator#validateOption
> It states in its JavaDoc that:
> Validates whether opt is a permissible Option shortOpt. The rules that
> specify if the opt is valid are:
> * it is not NULL
> * it is a single character that is either ' '(special case), '?', '@' or a
> letter
> * it is a multi characterthat only contains letters.
> The first check in the code though is:
> // check that opt is not NULL
> if (opt == null)
> {
> return;
> }
> Consider changing to...
> // check that opt is not NULL
> if (opt == null)
> {
> throw new IllegalArgumentException("The option cannot be NULL");
> }
--
This message was sent by Atlassian JIRA
(v6.1#6144)