From 59beff1a5b2d9cdff70fb27232abd87c6460f7d1 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 29 Jun 2016 18:30:48 +0300 Subject: [PATCH] EA-85118 Use Application.invokeAndWait --- .../src/git4idea/branch/GitBranchUiHandlerImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java index 75d95078d76f..f39461d60290 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUiHandlerImpl.java @@ -17,6 +17,8 @@ package git4idea.branch; import com.intellij.notification.Notification; import com.intellij.notification.NotificationListener; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; @@ -149,12 +151,9 @@ public class GitBranchUiHandlerImpl implements GitBranchUiHandler { @NotNull final String unmergedBranch, @NotNull final List mergedToBranches, @NotNull final String baseBranch) { final AtomicBoolean forceDelete = new AtomicBoolean(); - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - forceDelete.set(GitBranchIsNotFullyMergedDialog.showAndGetAnswer(myProject, history, unmergedBranch, mergedToBranches, baseBranch)); - } - }); + ApplicationManager.getApplication().invokeAndWait(() -> forceDelete.set( + GitBranchIsNotFullyMergedDialog.showAndGetAnswer(myProject, history, unmergedBranch, mergedToBranches, baseBranch)), + ModalityState.defaultModalityState()); return forceDelete.get(); }