Project: Eclipse_Platform_UI
Bug 173250 [EditorMgmt] NPE upon save all
Reported: 2007-02-07 05:08:12 | Status: verified fixed

I20070206-0010. SaveablesList holds on and uses savables (models) that are no longer available because the have been reported as being closed (removeModel has been calles). The SaveablesList correctly removes such models from the modelMap but might keep a reference as key of modelRefCounts. Later, those keys are used to return the open models (see getOpenModels()). Test Case: 1. open a shared file 2. open the same shared file a second time 3. make it dirty 4. close the first editor 5. Team > Compare With > Latest from HEAD ==> NPE: java version "1.5.0_10" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03) Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode) !SESSION 2007-02-07 10:45:46.658 ----------------------------------------------- eclipse.buildId=I20070206-0010 java.version=1.5.0_10 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH Framework arguments: -launcher C:\eclipse\drops\I20070206-0010\eclipse -name Eclipse 600 -product org.eclipse.sdk.ide -pdelaunch Command-line arguments: -launcher C:\eclipse\drops\I20070206-0010\eclipse -name Eclipse 600 -product org.eclipse.sdk.ide -data C:\eclipse\workspaces\Development_3_3\plugins/../eoe -dev file:C:/eclipse/workspaces/Development_3_3/plugins/.metadata/.plugins/org.eclipse.pde.core/eoe (Sun)/dev.properties -pdelaunch -os win32 -ws win32 -arch x86 -consolelog -clean !ENTRY org.eclipse.core.resources 2 10035 2007-02-07 10:45:49.599 !MESSAGE A workspace crash was detected. The previous session did not exit normally. !ENTRY org.eclipse.ui.ide 4 2 2007-02-07 10:58:05.658 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.ide". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:6421) at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3366) at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3339) at org.eclipse.ui.ide.IDE$1.run(IDE.java:1089) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1077) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction$6.run(CVSAction.java:588) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:152) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:117) at org.eclipse.swt.widgets.Display.syncExec(Display.java:3905) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.saveAllEditors(CVSAction.java:583) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.beginExecution(CVSAction.java:219) at org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction.beginExecution(WorkspaceAction.java:56) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.java:114) at org.eclipse.ui.actions.ActionDelegate.runWithEvent(ActionDelegate.java:70) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:243) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3490) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3104) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2264) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2228) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2103) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:457) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:452) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) 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:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416) at org.eclipse.equinox.launcher.Main.run(Main.java:1124) at org.eclipse.equinox.launcher.Main.main(Main.java:1099)

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