swingx
  1. swingx
  2. SWINGX-1418

Ensure that lookup for missing UI delegates returns null

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3
    • Component/s: Plaf
    • Labels:
      None

      Description

      A NPE can occur for SwingX based third party components in NetBeans visual editor.

      java.lang.NullPointerException
      at org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:315)
      at de.javasoft.swing.JYLabel.updateUI(JYLabel.java:77)
      at javax.swing.JLabel.<init>(JLabel.java:145)
      at javax.swing.JLabel.<init>(JLabel.java:216)
      at de.javasoft.swing.JYLabel.<init>(JYLabel.java:49)
      at de.javasoft.swing.JYLabel.<init>(JYLabel.java:46)
      at de.javasoft.swing.plaf.basic.BasicJYTabbedPaneUI$5.<init>(BasicJYTabbedPaneUI.java:1029)
      at de.javasoft.swing.plaf.basic.BasicJYTabbedPaneUI.addTab(BasicJYTabbedPaneUI.java:1029)
      at de.javasoft.swing.plaf.basic.BasicJYTabbedPaneUI.access$17(BasicJYTabbedPaneUI.java:1021)
      at de.javasoft.swing.plaf.basic.BasicJYTabbedPaneUI$4.propertyChange(BasicJYTabbedPaneUI.java:809)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
      at java.awt.Component.firePropertyChange(Component.java:8132)
      at de.javasoft.swing.JYTabbedPane.firePropertyChange(JYTabbedPane.java:1345)
      at de.javasoft.swing.JYTabbedPane.insertTab(JYTabbedPane.java:386)
      [catch] at org.netbeans.modules.form.layoutsupport.delegates.JTabbedPaneSupport.addComponentsToContainer(JTabbedPaneSupport.java:259)
      at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.addComponentsToContainer(LayoutSupportManager.java:668)
      at org.netbeans.modules.form.VisualReplicator.addComponent(VisualReplicator.java:391)
      at org.netbeans.modules.form.VisualReplicator.updateAddedComponents(VisualReplicator.java:357)
      at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2414)
      at org.netbeans.modules.form.FormLAF$3.run(FormLAF.java:329)
      at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
      at org.openide.util.Mutex.readAccess(Mutex.java:271)
      at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:312)
      at org.netbeans.modules.form.FormDesigner$FormListener.processEvents(FormDesigner.java:2339)
      at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:2305)
      at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:1296)
      at org.netbeans.modules.form.FormModel.fireEventBatch(FormModel.java:1269)
      at org.netbeans.modules.form.FormModel.firePendingEvents(FormModel.java:1232)
      at org.netbeans.modules.form.FormModel.access$000(FormModel.java:68)
      at org.netbeans.modules.form.FormModel$2.run(FormModel.java:1212)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Fix proposal: simply add a ui null check
      if (ui == null)
      return null;
      String realUI = ui.getClass().getName();
      Class<?> realUIClass;
      try {
      ...

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Karl Schaefer
            Reporter:
            wzberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5 minutes
              5m
              Remaining:
              Remaining Estimate - 5 minutes
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified