Project: Eclipse_Platform_UI
Bug 58597 [Workbench] EditorPresentation throws NPE when EditorPart returned null for ToolTip
Reported: 2004-04-14 23:20:11 | Status: resolved fixed

When an Editor Part returns null from getToolTip() method EditorPresentation.getLabelText() throws NPE if the "Show Multiple Editor Tabs" preference is not checked. java.lang.NullPointerException at org.eclipse.ui.internal.presentations.EditorPresentation.getLabelText (EditorPresentation.java:146) at org.eclipse.ui.internal.presentations.EditorList$EditorListLabelProvider.getText (EditorList.java:76) at org.eclipse.jface.viewers.ViewerSorter.compare(ViewerSorter.java:115) at org.eclipse.jface.viewers.ViewerSorter$1.compare (ViewerSorter.java:169) at java.util.Arrays.mergeSort(Arrays.java:1237) at java.util.Arrays.sort(Arrays.java:1185) at org.eclipse.jface.viewers.ViewerSorter.sort(ViewerSorter.java:167) at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren (StructuredViewer.java:571) at org.eclipse.jface.viewers.TableViewer.internalRefresh (TableViewer.java:452) at org.eclipse.jface.viewers.TableViewer.internalRefresh (TableViewer.java:436) at org.eclipse.jface.viewers.StructuredViewer$7.run (StructuredViewer.java:870) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection (StructuredViewer.java:810) at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:868) at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:830) at org.eclipse.jface.viewers.TableViewer.inputChanged (TableViewer.java:403) at org.eclipse.jface.viewers.ContentViewer.setInput (ContentViewer.java:238) at org.eclipse.jface.viewers.StructuredViewer.setInput (StructuredViewer.java:1004) at org.eclipse.ui.internal.presentations.AbstractTableInformationControl.inputChang ed(AbstractTableInformationControl.java:435) at org.eclipse.ui.internal.presentations.EditorList.setInput (EditorList.java:106) at org.eclipse.ui.internal.presentations.EditorPresentation.showList (EditorPresentation.java:219) at org.eclipse.ui.internal.presentations.EditorPresentation.access$0 (EditorPresentation.java:204) at org.eclipse.ui.internal.presentations.EditorPresentation$1.showList (EditorPresentation.java:62) at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1927) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:280) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:810) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2424) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2102) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1448) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1419) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:257) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:90) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:260) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:173) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:106) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:305) at org.eclipse.core.launcher.Main.run(Main.java:729) at org.eclipse.core.launcher.Main.main(Main.java:713)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PresentableEditorPart.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PresentableViewPart.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/BasicStackPresentation.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/EditorPresentation.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/Util.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/IPresentablePart.java