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
* opportunity to transfer any thread-local state to the execution thread before 
     * control is transferred to the new thread.
     *</p>
     * @param operation the runnable to run
     * @param fork <code>true</code> if the runnable should run in a separate thread,
     *   and <code>false</code> if in the same thread
     * @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
     * @exception InvocationTargetException if the run method must propagate a checked exception,
     * 	it should wrap it inside an <code>InvocationTargetException</code>; runtime exceptions and errors are automatically
     *  wrapped in an <code>InvocationTargetException</code> by this method
     * @exception InterruptedException if the operation detects a request to cancel, 
     *  using <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing 
     *  <code>InterruptedException</code>; this method propagates the exception
     */
    public static void run(IRunnableWithProgress operation, boolean fork,
            IProgressMonitor monitor, Display display)
            throws InvocationTargetException, InterruptedException {
        Assert.isTrue(operation != null && monitor != null);
        modalLevel++;
        try {
            if (monitor != null)
                monitor.setCanceled(false);
            
            if (!fork || !runInSeparateThread) {
                runInCurrentThread(operation, monitor);
            } else {
                ModalContextThread t = getCurrentModalContextThread();
                if (t != null) {