Project: Eclipse_Platform_UI
Bug 374001 Selecting chevron menu when containing a part without icon throws NPE
Reported: 2012-03-12 15:42:28 | Status: resolved fixed

0. Ensure you have the CSS editor support available. 1. Open a ".css" file (e.g., blue-gradient.css from org.eclipse.e4.demo.contacts). 2. Select the chevron or hit Ctrl-E to bring up the drop-down 3. See NPE. I think the problem is that the CSS file editor doesn't specify an icon as iconURI = null. java.lang.NullPointerException at org.eclipse.emf.common.util.URI.createURIWithCache(URI.java:663) at org.eclipse.emf.common.util.URI.createURI(URI.java:535) at org.eclipse.e4.ui.internal.workbench.renderers.swt.BasicPartList.getLabelImage(BasicPartList.java:91) at org.eclipse.e4.ui.internal.workbench.renderers.swt.BasicPartList.access$0(BasicPartList.java:87) at org.eclipse.e4.ui.internal.workbench.renderers.swt.BasicPartList$BasicStackListLabelProvider.getImage(BasicPartList.java:55) at org.eclipse.jface.viewers.ColumnLabelProvider.update(ColumnLabelProvider.java:37) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152) at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:399) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:485) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2167) at org.eclipse.jface.viewers.AbstractTableViewer.createItem(AbstractTableViewer.java:277) at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:757) at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:649) at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:636) at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:592) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1443) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404) at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:590) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690) at org.eclipse.e4.ui.internal.workbench.renderers.swt.BasicPartList.setInput(BasicPartList.java:141) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showAvailableItems(StackRenderer.java:913) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$8.showList(StackRenderer.java:864) at org.eclipse.e4.ui.widgets.CTabFolder.onSelection(CTabFolder.java:2036) at org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:279) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4135) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3981) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3620) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1015) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:909) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:580) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:535) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Files changed in fix:
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java