BELUGA BEHR created CLI-241:
-------------------------------
Summary: 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
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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira