Project: Eclipse_Platform_UI
Bug 156410 [Workbench] [RCP] SaveAllEditors ArrayIndexOutofBoundsException
Reported: 2006-09-06 13:59:12 | Status: verified fixed

When attempting to programmatically close my RCP application via WorkBench.close(), I get an ArrayIndexOutofBoundsException. The relevent stack is: java.lang.ArrayIndexOutOfBoundsException at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:769) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.saveAllEditors(Workbench.java:735) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:655) at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:639) at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:839) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.Workbench.close(Workbench.java:837) at org.eclipse.ui.internal.Workbench.close(Workbench.java:812) The reason seems to be that by the time close gets called, there are no available workbench windows but line 769 in the workbench class does not check for this state.

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