Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-241

OptionValidator Implementation Does Not Agree With JavaDoc

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Component/s: Validation
    • Labels:
      None

      Description

      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"); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              belugabehr David Mollitor
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: