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

OptionValidator Implementation Does Not Agree With JavaDoc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • Validation
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: