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
* a wrapper around, the second progress monitor.
     *
     * @param monitor1 the first progress monitor
     * @param monitor2 the second progress monitor
     * @return <code>true</code> if the first is the same as, or
     *   a wrapper around, the second
     * @see ProgressMonitorWrapper
     */
    public static boolean canProgressMonitorBeUsed(IProgressMonitor monitor1,
            IProgressMonitor monitor2) {
        if (monitor1 == monitor2)
            return true;
        while (monitor1 instanceof ProgressMonitorWrapper) {
            monitor1 = ((ProgressMonitorWrapper) monitor1)
                    .getWrappedProgressMonitor();
            if (monitor1 == monitor2)
                return true;
        }
        return false;
    }
    /**
     * Checks with the given progress monitor and throws 
     * <code>InterruptedException</code> if it has been canceled.
     * <p>
     * Code in a long-running operation should call this method
     * regularly so that a request to cancel will be honored.
     * </p>
     * <p>
     * Convenience for:
     * <pre>