Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 130114

Summary: [EditorMgmt] Typo in error message when IEditorInput's tool tip is null
Product: [Eclipse Project] Platform Reporter: Auerliano <saveez>
Component: UIAssignee: Douglas Pollock <douglas.pollock>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Auerliano CLA 2006-03-02 08:20:50 EST
Try to create an editor which its corresponding editor input class has a getToolTipText() which returns null and when creating the editor you will get:

Unable to create this part due to an internal error. Reason for the failure: null argument;

It is surprising that tiny problems like this which create non-obvious confusing conditions for the developer has never been reported previously. Editors are non-detachable part of eclipse and bugs like this may suggest that eclipse developers may have never tried to create an editor without an input tooltip! A similar problem, where the optional icon field is null, has been reported at https://bugs.eclipse.org/bugs/show_bug.cgi?id=129765 and is still pending.


org.eclipse.ui.internal.misc.AssertionFailedException: null argument;
	at org.eclipse.ui.internal.misc.Assert.isNotNull(Assert.java:81)
	at org.eclipse.ui.internal.misc.Assert.isNotNull(Assert.java:68)
	at org.eclipse.ui.internal.PartTester.testWorkbenchPart(PartTester.java:101)
	at org.eclipse.ui.internal.PartTester.testEditor(PartTester.java:37)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:619)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:384)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:283)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:126)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:269)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:391)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1102)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1051)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1256)
	at org.eclipse.ui.internal.PartStack.add(PartStack.java:442)
	at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:109)
	at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
	at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:212)
	at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:202)
	at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:758)
	at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:665)
	at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:628)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2360)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2295)
	at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:2287)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2273)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2268)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2241)
	at org.example.ExampleEditorAction.run(PulseEditorAction.java:24)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.example.Application.run(Application.java:18)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Douglas Pollock CLA 2006-03-06 11:54:37 EST
The JavaDoc for getToolTipText in the 3.2 stream says: "@return the tool tip text; never <code>null</code>."  The error message should read "org.eclipse.ui.internal.misc.AssertionFailedException: null argument: The editor input must have a non-null tool tip".  There was a typo which I've corrected for 3.2 I20060307-0800.  I've hijacked this bug to cover that typo.