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

BasicComboBoxEditor throws NullPointerException

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version " 1.7.0_17 "
      Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
      Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      if BasicComboBoxEditor.setItem(Object) is being called with an object whose toString() method has been overridden, and it returns a null, the setItem(Object) method throws a NullPointerException.

      This bug has been introduced due to a fix of another bug (4530952) .

      The String " text " cannot be assumed to be non-null.

      REGRESSION. Last worked in version 6u45

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Same as description

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Proper Exception Handling/null check, so that no exceptions are thrown in the UI thread.
      ACTUAL -
      NullPointerException

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Making sure that toString() method of the object never resolves to a null value.

            malenkov Sergey Malenkov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: