Community
Participate
Working Groups
build i0325:2030 - download build - start Eclipse (with 2 editors previously open) - click on the close X of the editor which isn't in focus - editor doesn't close and you get the following NPE in the console osgi> !SESSION Mar 25, 2004 22:08:25.710 --------------------------------------- ------ java.version=1.4.2 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -showlocation -vmargs -cp C:\eclipse\dev\i0325-2030\ecli pse\startup.jar org.eclipse.core.launcher.Main !ENTRY org.eclipse.ui 4 4 Mar 25, 2004 22:08:25.720 !MESSAGE Unhandled event loop exception Unhandled event loop exception Reason: !ENTRY org.eclipse.ui 4 0 Mar 25, 2004 22:08:25.730 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:952 ) at org.eclipse.ui.internal.EditorManager.saveEditor(EditorManager.java:9 95) at org.eclipse.ui.internal.WorkbenchPage.closeEditors2(WorkbenchPage.jav a:990) at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java: 883) at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:97) at org.eclipse.ui.internal.EditorWorkbook.close(EditorWorkbook.java:235) at org.eclipse.ui.internal.EditorWorkbook$1.close(EditorWorkbook.java:10 8) at org.eclipse.ui.internal.presentations.BasicStackPresentation$6.close( BasicStackPresentation.java:182) at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2012) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2578) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2256) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1562) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1536) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a: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(PlatformAct ivator.java:277) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:239) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:117) 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:316) at org.eclipse.core.launcher.Main.run(Main.java:741) at org.eclipse.core.launcher.Main.main(Main.java:725) java.lang.NullPointerException
Note if I make the editor have focus and then put it in the background it can close OK.
Workaround is either to activate the editor first before closing, or to do a File > Close All then reopen the editors as needed. Apparently a problem with lazily recreated editors.
Fixed by backing out original fix for bug 55905.
This was caused by a later reference to a null IEditorPart (a lazy editor), similar to the problem Kim raised in bug 55905 comment #5.
Verified on Windows XP with Build id: 200403260800.