Bug 78222 [JFace] ModalContext event loop should guard against SWTExceptions
I was generating a patch and clicking Finish on the wizard would not close the wizard even though the patch was created succesfully. It turned out that the problem was that writing to the console caused an error due to word wrap being on. There are two problems here. There was no error message shown to the user and writing to the console should not cause a command to fail.
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.java
/**
     * Indicated whether ModalContext is in debug mode;
     * <code>false</code> by default.
     */
    private static boolean debug = false;
    
    /**
     * The number of nested modal runs, or 0 if not inside a modal run.
     * This is global state.
     */
    private static int modalLevel = 0;
    /**
     * Indicates whether operations should be run in a separate thread.
     * Defaults to true.
     * For internal debugging use, set to false to run operations in the calling thread.
     */
    private static boolean runInSeparateThread = true;
    /**
     * Thread which runs the modal context.
     */
    private static class ModalContextThread extends Thread {