Project: Eclipse_Platform_UI
Bug 24817 [Editor Mgmt] NPE logged when restoring editor on deleted resource
Reported: 2002-10-16 05:50:09 | Status: resolved fixed

Build 20021015 When checking out a bunch of changes from CVS, many editors previously opened onto stale units (on repository, units have moved to different package location), did not close automatically. When selecting them, the log got populated with following stack dumps. Other than the log, the behavior was acceptable, though I would have preferred if it had warned me once for all stale editors (close|close all|cancel). !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:10:51.890 !MESSAGE Unable to restore editor - createElement returned null for input elemen t factory: org.eclipse.ui.part.FileEditorInputFactory Unable to restore editor - createElement returned null for input element factory : org.eclipse.ui.part.FileEditorInputFactory !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:10:51.968 !MESSAGE Unable to restore editor - createElement returned null for input elemen t factory: org.eclipse.ui.part.FileEditorInputFactory Unable to restore editor - createElement returned null for input element factory : org.eclipse.ui.part.FileEditorInputFactory !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:11:10.359 !MESSAGE Unhandled exception caught in event loop. Unhandled exception caught in event loop. Reason: !ENTRY org.eclipse.ui 4 0 Oct 16, 2002 12:11:10.375 !MESSAGE Failed to execute runnable (java.lang.NullPointerException) !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerE xception) at org.eclipse.swt.SWT.error(SWT.java:2139) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja va:97) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1599) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1372) at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(Mod alContext.java:133) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:258) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDi alog.java:393) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.jav a:255) at org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction.exe cute(ReplaceWithRemoteAction.java:45) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.jav a:70) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:2 10) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(Act ionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContri butionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handle Event(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1360) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1343) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa der.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) Failed to execute runnable (java.lang.NullPointerException) !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:11:10.375 !MESSAGE *** Stack trace of contained exception *** *** Stack trace of contained exception *** Reason: !ENTRY org.eclipse.ui 4 0 Oct 16, 2002 12:11:10.390 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPartReference.releaseReferences(Work benchPartReference.java:41) at org.eclipse.ui.internal.EditorManager$Editor.releaseReferences(Editor Manager.java:1187) at org.eclipse.ui.internal.EditorManager$Editor.getEditor(EditorManager. java:1183) at org.eclipse.ui.internal.EditorManager$Editor.getPart(EditorManager.ja va:1160) at org.eclipse.ui.internal.EditorWorkbook.setVisibleEditor(EditorWorkboo k.java:767) at org.eclipse.ui.internal.EditorWorkbook$2.widgetSelected(EditorWorkboo k.java:134) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 87) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:849) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:1681) at org.eclipse.swt.custom.CTabFolder.destroyItem(CTabFolder.java:498) at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:104) at org.eclipse.ui.internal.EditorWorkbook.removeTab(EditorWorkbook.java: 612) at org.eclipse.ui.internal.EditorWorkbook.remove(EditorWorkbook.java:550 ) at org.eclipse.ui.internal.EditorArea.removeEditor(EditorArea.java:184) at org.eclipse.ui.internal.EditorPresentation.closeEditor(EditorPresenta tion.java:81) at org.eclipse.ui.internal.EditorPresentation.closeEditor(EditorPresenta tion.java:62) at org.eclipse.ui.internal.EditorManager.closeEditor(EditorManager.java: 114) at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java: 694) at org.eclipse.ui.internal.EditorManager$Editor.getEditor(EditorManager. java:1172) at org.eclipse.ui.internal.EditorManager$Editor.getPart(EditorManager.ja va:1160) at org.eclipse.ui.internal.EditorWorkbook.setVisibleEditor(EditorWorkboo k.java:767) at org.eclipse.ui.internal.EditorWorkbook$2.widgetSelected(EditorWorkboo k.java:134) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 87) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:849) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:1681) at org.eclipse.swt.custom.CTabFolder.destroyItem(CTabFolder.java:498) at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:104) at org.eclipse.ui.internal.EditorWorkbook.removeTab(EditorWorkbook.java: 612) at org.eclipse.ui.internal.EditorWorkbook.remove(EditorWorkbook.java:544 ) at org.eclipse.ui.internal.EditorArea.removeEditor(EditorArea.java:184) at org.eclipse.ui.internal.EditorPresentation.closeEditor(EditorPresenta tion.java:81) at org.eclipse.ui.internal.EditorPresentation.closeEditor(EditorPresenta tion.java:71) at org.eclipse.ui.internal.EditorManager.closeEditor(EditorManager.java: 110) at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java: 724) at org.eclipse.ui.texteditor.AbstractTextEditor$9.run(AbstractTextEditor .java:2110) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:31) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja va:94) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1599) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1372) at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(Mod alContext.java:133) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:258) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDi alog.java:393) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.jav a:255) at org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction.exe cute(ReplaceWithRemoteAction.java:45) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.jav a:70) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:2 10) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(Act ionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContri butionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handle Event(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1360) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1343) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa der.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) java.lang.NullPointerException !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:12:19.140 !MESSAGE Unable to restore editor - createElement returned null for input elemen t factory: org.eclipse.ui.part.FileEditorInputFactory Unable to restore editor - createElement returned null for input element factory : org.eclipse.ui.part.FileEditorInputFactory !ENTRY org.eclipse.ui 4 4 Oct 16, 2002 12:12:20.421 !MESSAGE Unhandled exception caught in event loop. Unhandled exception caught in event loop. Reason: !ENTRY org.eclipse.ui 4 0 Oct 16, 2002 12:12:20.421 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPartReference.releaseReferences(Work benchPartReference.java:41) at org.eclipse.ui.internal.EditorManager$Editor.releaseReferences(Editor Manager.java:1187) at org.eclipse.ui.internal.EditorManager$Editor.getEditor(EditorManager. java:1183) at org.eclipse.ui.internal.dialogs.WorkbenchEditorsDialog$Adapter.activa te(WorkbenchEditorsDialog.java:545) at org.eclipse.ui.internal.dialogs.WorkbenchEditorsDialog$Adapter.access $0(WorkbenchEditorsDialog.java:543) at org.eclipse.ui.internal.dialogs.WorkbenchEditorsDialog.okPressed(Work benchEditorsDialog.java:423) at org.eclipse.ui.internal.dialogs.WorkbenchEditorsDialog$8.widgetDefaul tSelected(WorkbenchEditorsDialog.java:229) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 94) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368) at org.eclipse.jface.window.Window.runEventLoop(Window.java:563) at org.eclipse.jface.window.Window.open(Window.java:543) at org.eclipse.ui.internal.WorkbenchEditorsAction.run(WorkbenchEditorsAc tion.java:36) at org.eclipse.jface.action.Action.runWithEvent(Action.java:749) at org.eclipse.ui.internal.registry.AcceleratorScope$AcceleratorAction.r un(AcceleratorScope.java:289) at org.eclipse.ui.internal.registry.AcceleratorScope.processKey(Accelera torScope.java:249) at org.eclipse.ui.internal.KeyBindingMenu$1.keyPressed(KeyBindingMenu.ja va:54) at org.eclipse.ui.internal.KeyTable.handleEvent(KeyTable.java:75) at org.eclipse.ui.internal.KeyTable$3.handleEvent(KeyTable.java:116) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1360) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1343) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa der.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) java.lang.NullPointerException

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java