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

NPE thrown when calling SwingUtilities.updateComponentTreeUI

    XMLWordPrintable

    Details

      Description

      NPE thrown when calling SwingUtilities.updateComponentTreeUI.
      .I am trying to make a testcase for JFormattedTextField, I am having an array of all the four LAF, and calling runtest after setting each of them and calling SwingUtilities.updateComponentTreeUI(this). And when the programme calls the runtest for GTK LAF then this erros occurs.

      Steps to reproduce:
      -------------------
      1) Compile and Run the attached code.
      2) This exception is random in nature.

      It is observed on Linux RH , win2k-prof and Solaris.

      The stacktrace is :
      -------------------
      java.lang.NullPointerException
              at javax.swing.plaf.synth.SynthContext.getPainter(SynthContext.java:181)
              at javax.swing.plaf.synth.SynthRootPaneUI.update(SynthRootPaneUI.java:77
      )
              at javax.swing.JComponent.paintComponent(JComponent.java:685)
              at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4739)
              at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
              at javax.swing.JComponent.paint(JComponent.java:937)
              at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
              at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:
      60)
              at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97
      )
              at java.awt.Container.paint(Container.java:1647)
              at javax.swing.JFrame.update(JFrame.java:390)
              at sun.awt.RepaintArea.updateComponent(RepaintArea.java:192)
              at sun.awt.RepaintArea.paint(RepaintArea.java:169)
              at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:406)
              at java.awt.Component.dispatchEventImpl(Component.java:3975)
              at java.awt.Container.dispatchEventImpl(Container.java:1962)
              at java.awt.Window.dispatchEventImpl(Window.java:1621)
              at java.awt.Component.dispatchEvent(Component.java:3750)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:214)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      java.lang.NullPointerException
              at javax.swing.plaf.synth.SynthLookAndFeel.paintRegion(SynthLookAndFeel.
      java:345)
              at javax.swing.plaf.synth.SynthLookAndFeel.update(SynthLookAndFeel.java:
      309)
              at javax.swing.plaf.synth.SynthPanelUI.update(SynthPanelUI.java:93)
              at javax.swing.JComponent.paintComponent(JComponent.java:685)
              at javax.swing.JComponent.paint(JComponent.java:947)
              at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
              at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
              at javax.swing.JComponent._paintImmediately(JComponent.java:4631)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4438)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
      EventQueueUtilities.java:117)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:188)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:459)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:214)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      java.lang.NullPointerException
              at javax.swing.plaf.synth.SynthLookAndFeel.paintRegion(SynthLookAndFeel.
      java:345)
              at javax.swing.plaf.synth.SynthLookAndFeel.update(SynthLookAndFeel.java:
      309)
              at javax.swing.plaf.synth.SynthTextFieldUI.update(SynthTextFieldUI.java:
      143)
              at javax.swing.JComponent.paintComponent(JComponent.java:685)
              at javax.swing.JComponent.paint(JComponent.java:947)
              at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
              at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
              at javax.swing.JComponent._paintImmediately(JComponent.java:4631)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4438)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
      EventQueueUtilities.java:117)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:188)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:459)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:214)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      java.lang.NullPointerException
              at javax.swing.plaf.synth.SynthLabelUI.getPreferredSize(SynthLabelUI.jav
      a:133)
              at javax.swing.JComponent.getPreferredSize(JComponent.java:1422)
              at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:895)
              at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:806)
              at java.awt.GridBagLayout.ArrangeGrid(GridBagLayout.java:1386)
              at java.awt.GridBagLayout.arrangeGrid(GridBagLayout.java:1346)
              at java.awt.GridBagLayout.layoutContainer(GridBagLayout.java:706)
              at java.awt.Container.layout(Container.java:1356)
              at java.awt.Container.doLayout(Container.java:1346)
              at java.awt.Container.validateTree(Container.java:1428)
              at java.awt.Container.validateTree(Container.java:1435)
              at java.awt.Container.validateTree(Container.java:1435)
              at java.awt.Container.validate(Container.java:1403)
              at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
      ava:353)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
      EventQueueUtilities.java:116)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:188)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:459)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:214)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


      I also get this stack trace sometime:
      java.lang.NullPointerException
              at javax.swing.plaf.synth.SynthContext.getPainter(SynthContext.java:181)
              at javax.swing.plaf.synth.SynthRootPaneUI.update(SynthRootPaneUI.java:77)
              at javax.swing.JComponent.paintComponent(JComponent.java:685)
              at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4739)
              at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
              at javax.swing.JComponent.paint(JComponent.java:937)
              at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
              at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
              at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
              at java.awt.Container.paint(Container.java:1647)
              at javax.swing.JFrame.update(JFrame.java:390)
              at sun.awt.RepaintArea.updateComponent(RepaintArea.java:192)
              at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:43)
              at sun.awt.RepaintArea.paint(RepaintArea.java:169)
              at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:648)
              at java.awt.Component.dispatchEventImpl(Component.java:3975)
              at java.awt.Container.dispatchEventImpl(Container.java:1962)
              at java.awt.Window.dispatchEventImpl(Window.java:1621)
              at java.awt.Component.dispatchEvent(Component.java:3750)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:214)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

        Attachments

          Activity

            People

            Assignee:
            svioletsunw Scott Violet (Inactive)
            Reporter:
            mjoshisunw Mayank Joshi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: