Skip to content

Commit 8c215cb

Browse files
committed
[trivial] disconnectFromWorkspace() unconditionally opens error dialog
The code in IDEWorkbenchAdvisor.disconnectFromWorkspace() relies on the fact that ErrorDialog.openError() "will only be displayed if there is at least one child status matching the mask". While that is technically OK, it surprises a lot to see the code outside of the if(status is bad) block trying to open an error dialog. If we check for errors anyway, let open the error dialog only in that case. Change-Id: Id7567d27b6fafa8a1d90ae978f85f23f5729fcce
1 parent 2077a79 commit 8c215cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,10 @@ protected void disconnectFromWorkspace() {
569569
IDEWorkbenchPlugin.IDE_WORKBENCH, 1,
570570
IDEWorkbenchMessages.InternalError, e));
571571
}
572-
ErrorDialog.openError(null,
573-
IDEWorkbenchMessages.ProblemsSavingWorkspace, null, status,
574-
IStatus.ERROR | IStatus.WARNING);
575572
if (!status.isOK()) {
573+
ErrorDialog.openError(null,
574+
IDEWorkbenchMessages.ProblemsSavingWorkspace, null, status,
575+
IStatus.ERROR | IStatus.WARNING);
576576
IDEWorkbenchPlugin.log(
577577
IDEWorkbenchMessages.ProblemsSavingWorkspace, status);
578578
}

0 commit comments

Comments
 (0)