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
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
/**
 * An application window is a high-level "main window", with built-in
 * support for an optional menu bar with standard menus, an optional toolbar,
 * and an optional status line.
 * <p>
 * Creating an application window involves the following steps:
 * <ul>
 *   <li>creating an instance of <code>ApplicationWindow</code>
 *   </li>
 *   <li>assigning the window to a window manager (optional)
 *   </li>
 *   <li>opening the window by calling <code>open</code>
 *   </li>
 * </ul>
 * Only on the last step, when the window is told to open, are
 * the window's shell and widget tree created. When the window is
 * closed, the shell and widget tree are disposed of and are no longer
 * referenced, and the window is automatically removed from its window
 * manager. Like all windows, an application window may be reopened.
 * </p>
 * <p>
 * An application window is also a suitable context in which to perform 
 * long-running operations (that is, it implements <code>IRunnableContext</code>).
 * </p>
 */
public class ApplicationWindow extends Window implements IRunnableContext {