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

Coding error: OptionGroup.setSelected causes java.lang.NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • None
    • None

    Description

      Code snippet from OptionGroup.setSelected(Option option):
      ...
      if (selected == null || selected.equals(option.getOpt()))

      { selected = option.getOpt(); }

      else

      { throw new AlreadySelectedException(this, option); }

      ...
      When parameter option is "null" to reset the selected option, selected.equals(option.getOpt()) will obviously fail.
      Issue is already fixed in the head revision of 1.3.

      Attachments

        Activity

          People

            Unassigned Unassigned
            prong gg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: