Bug 25955 [Workbench] Exiting while saving can cause problems
This seems to be a problem with either the workbench in general or the editor structure in particular. I have reproduced this with the Java editor but there is no reason why it wouldn't occur with other editors as well. Dirty a Java editor. Press Ctrl+S to save the editor. While it is saving, quickly close the main perspective window, either by clicking the X or by choosing File->Save. When prompted to save dirty resources say Okay. An error dialog appears stating that the save failed, and a stack trace is printed to the log (sorry, I don't have my log anymore, but it's fairly easy to reproduce). The dialog says: "Problems occurred while trying to save the state of the workbench." Details: "Save cannot be called from inside an operation." I guess the real problem is that I'm able to exit while a workspace operation is taking place. Reproduced on both Win2K and Linux.
bundles/org.eclipse.ui.workbench/extensions/org/eclipse/jface/window/ApplicationWindow.java
* <p>
 * Subclasses may override this method to customize the tool bar manager.
 * </p>
 * @return a Control
 */
protected Control getToolBarControl() {
	if (toolBarManager == null) return null;
	if (toolBarManager instanceof ToolBarManager) {
		return ((ToolBarManager)toolBarManager).getControl();
	}
	return null;
}
/* (non-Javadoc)
 * Method declared on IRunnableContext.
 */
public void run(final boolean fork, boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
	final StatusLineManager mgr = getStatusLineManager();
	if (mgr == null) {
		runnable.run(new NullProgressMonitor());
		return;
	}
	boolean cancelWasEnabled = mgr.isCancelEnabled();
	final Control contents = getContents();
	final Display display = contents.getDisplay();
	Shell shell = getShell();
	boolean contentsWasEnabled = contents.isEnabled();
	MenuManager manager = getMenuBarManager();
	Menu menuBar = null;
	if (manager != null) {
		menuBar = manager.getMenu();