Bug 88965 - Some editor is returning null from getEditorInput()
Summary: Some editor is returning null from getEditorInput()
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-03-24 01:05 EST by Darin Swanson CLA
Modified: 2007-06-22 10:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2005-03-24 01:05:31 EST
In I20050323-1615 on WinXP any way I attempt to open the problems view I get 
the view with "cool" unable to create view embedded in the view and lists the 
following stack trace:

java.lang.NullPointerException
	at org.eclipse.ui.ide.ResourceUtil.getFile(ResourceUtil.java:43)
	at 
org.eclipse.ui.views.markers.internal.MarkerView.focusSelectionChanged
(MarkerView.java:578)
	at org.eclipse.ui.views.markers.internal.MarkerView.createPartControl
(MarkerView.java:314)
	at org.eclipse.ui.internal.ViewFactory.busyRestoreViewHelper
(ViewFactory.java:429)
	at org.eclipse.ui.internal.ViewFactory.busyRestoreView
(ViewFactory.java:299)
	at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:697)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:69)
	at org.eclipse.ui.internal.ViewFactory.restoreView
(ViewFactory.java:694)
	at org.eclipse.ui.internal.ViewFactory$ViewReference.getPart
(ViewFactory.java:119)
	at org.eclipse.ui.internal.WorkbenchPage$ActivationList.getActive
(WorkbenchPage.java:3426)
	at org.eclipse.ui.internal.WorkbenchPage$ActivationList.getActive
(WorkbenchPage.java:3407)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor
(WorkbenchPage.java:1113)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor
(WorkbenchPage.java:1057)
	at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:116)
	at org.eclipse.ui.internal.PartStack.close(PartStack.java:465)
	at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:208)
	at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:98)
	at 
org.eclipse.ui.internal.presentations.newapi.TabbedStackPresentation$1.handleEv
ent(TabbedStackPresentation.java:81)
	at 
org.eclipse.ui.internal.presentations.newapi.AbstractTabFolder.fireEvent
(AbstractTabFolder.java:263)
	at 
org.eclipse.ui.internal.presentations.newapi.AbstractTabFolder.fireEvent
(AbstractTabFolder.java:272)
	at 
org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.acce
ss$1(DefaultTabFolder.java:1)
	at 
org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.cl
oseButtonPressed(DefaultTabFolder.java:64)
	at 
org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners
(PaneFolder.java:546)
	at org.eclipse.ui.internal.presentations.PaneFolder$3.close
(PaneFolder.java:190)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2078)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:291)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1571)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1535)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:312)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:103)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:338)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:151)
	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.invokeFramework(Main.java:268)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
	at org.eclipse.core.launcher.Main.run(Main.java:887)
	at org.eclipse.core.launcher.Main.main(Main.java:871)
Comment 1 Stefan Xenos CLA 2005-03-24 20:09:53 EST
It appears that the active editor was returning null as its IEditorInput.

This is a bug in the editor, not the problem view... however, the problem view
only became sensitive to this type of thing as a result of bug 87288. I've added
a paranoia check for null editor inputs, so the problems view is once again
protected from buggy editors...

However, the real problem is the editor with the bogus input and it's hard to
address that without knowing what editor was active at the time.

I'm reassigning this to JDT on the general assumption that you had a java editor
active at the time... but about the best anyone can do is double-check that
there's no obvious way for getEditorInput() to return null and close this as
WORKSFORME if they don't find anything. If you notice this again, please
indicate what editor had focus at the time the exception was thrown.
Comment 2 Stefan Xenos CLA 2005-03-24 20:28:16 EST
I've added a check for a non-null editor input at creation time. The workbench
will now refuse to create an editor if the editor input is null at creation
time. Hopefully this will help catch the culprit.
Comment 3 Nick Edgar CLA 2005-03-24 22:15:37 EST
getEditorInput() can return null after the editor has been disposed.
But then it shouldn't be firing selection changed events.

This could happen if the selection service got a part activation after the part
had been disposed.  But that shouldn't happen either.
Comment 4 Dani Megert CLA 2005-03-28 10:22:39 EST
Darin, which editor was active? If an editor is open and active the input should
not be null. Do you have steps to reproduce?
Comment 5 Darin Swanson CLA 2005-03-28 19:12:20 EST
no steps to reproduce.
Comment 6 Nick Edgar CLA 2005-04-12 11:11:27 EDT
I suspect the null result from getEditorInput() is due to bug 89246.
Comment 7 Dani Megert CLA 2007-06-22 09:59:19 EDT
Get rid of deprecated state.
Comment 8 Dani Megert CLA 2007-06-22 10:04:34 EDT
.