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

REGRESSION: wrong AppContext causes NPE in MetalLookAndFeel.getTheme

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.3.1
    • client-libs



      Name: sv35042 Date: 10/18/2002


      FULL PRODUCT VERSION :
      java version "1.3.1_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02)
      Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode)

      Java Webstart 1.0.1_02 build (b03)

      FULL OPERATING SYSTEM VERSION : WIndows 2000

      ADDITIONAL OPERATING SYSTEMS : build 2195 SP1



      A DESCRIPTION OF THE PROBLEM :
      When running our application with Java Webstart 1.01_02 we get the following exception:

      Exception occurred during event dispatching:
      java.lang.NullPointerException
      at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)

      getControlInfo is getting null when it calls getTheme (see the Swing source code, getControlInfo is
      a 1 line method: getCurrentTheme ().getControInfo ()

      this appears to be similar to bug# 4524547 where the wrong AppContext is being used.
       the correct AppContext needs to be used and/or
      getCurrentTheme () needs to be fixed so it never returns null

      we don't see the error with webstart 1.01_01 or when running as a local application
      or when running with the plug-in.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. I am only able to reproduce this running our application,
      but looking at the source code makes it obvious what the problem is:
      getCurrentTheme() returns null
      2.
      3.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception occurred during event dispatching:
      java.lang.NullPointerException
      at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
       at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
        at javax.swing.JComponent.paintWithBuffer(Unknown Source)
       at javax.swing.JComponent._paintImmediately(Unknown Source)
        at javax.swing.JComponent.paintImmediately(Unknown Source)
         at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
          at java.awt.EventQueue.dispatchEvent(Unknown Source)
          at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(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 ----------
      I am only able to reproduce this running our application,
      but looking at the source code makes it obvious what the problem is:
      getCurrentTheme() returns null.

      It seems to happen very often when I have my applications debug messages enabled (a lot of output to System.out)

      ---------- END SOURCE ----------

      Release Regression From : 1.3.1
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 165700)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: