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
/**
         * The display used for event dispatching.
         */
        private Display display;
        /**
         * Indicates whether to continue event queue dispatching.
         */
        private volatile boolean continueEventDispatching = true;
        
        /**
         * The thread that forked this modal context thread.
         * 
         * @since 3.1
         */
        private Thread callingThread;
        
        /**
         * Creates a new modal context.
         * 
         * @param operation the runnable to run
         * @param monitor the progress monitor to use to display progress and receive
         *   requests for cancelation
         * @param display the display to be used to read and dispatch events
         */
        private ModalContextThread(IRunnableWithProgress operation,
                IProgressMonitor monitor, Display display) {
            super("ModalContext"); 
            Assert.isTrue(monitor != null && display != null);
            runnable = operation;
            progressMonitor = new AccumulatingProgressMonitor(monitor, display);