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

REGRESSION: Exception occurs when updateUI for JTree is triggered by KeyEvent

XMLWordPrintable

    • b22
    • x86
    • windows_2003
    • Not verified

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b98)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b98, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 5.2.3790]

      A DESCRIPTION OF THE PROBLEM :
      This bug report is for a regression for closed bug: 4264002 .

      This bug has been encountered in JRE 1.6.
      see 4264002 for details.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      When a JTree's updateUI() is called as a result of a key event, a NullPointerExcpetion is thrown from the JTree$Handler's isNavigationKey() method.

      See the example code in 4264002 for an example of the problem.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The library keyAdapter() methods should check for null elements, so as not to throw a NullPointerException
      ACTUAL -
      A NullPointerException is thrown

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at javax.swing.plaf.basic.BasicTreeUI$Handler.isNavigationKey(Unknown Source)
      at javax.swing.plaf.basic.BasicTreeUI$Handler.keyPressed(Unknown Source)
      at java.awt.AWTEventMulticaster.keyPressed(Unknown Source)
      at java.awt.Component.processKeyEvent(Unknown Source)
      at javax.swing.JComponent.processKeyEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See the example code in 4264002 for an example of the problem.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
        Bug 4264002 states that running updateUI() wrapped in a SwingUtilities.invokeLater() is a potential workaround.

      This is not a practical workaround in all cases (although when possible, it does fix this particular problem).

            alexp Alexander Potochkin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: