Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4287257

DefaultKeySelectionManager assumes no null values in ComboBoxModel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • beta
    • generic
    • generic



      Name: skT88420 Date: 11/02/99


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)
      JComboBox's DefaultKeySelectionManager assumes that all values in the
      ComboBoxModel are not nulls. In many places, it does:
      <pre><code>
      v = aModel.getElementAt(i).toString().toLowerCase();
      </code></pre>

      If the value at getElement(i) is null, this fails with a NullPointerException.

      The proper code should probably be:
      <pre><code>
      v = String.valueOf(aModel.getElementAt(i)).toLowerCase();
      </code></pre>
      (Review ID: 97299)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: