From 0b14159f9f1b436d4eaa5823e964fd9cdf4d3780 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Tue, 7 May 2019 15:31:11 +0300 Subject: [PATCH] IDEA-212235 merge: do not access Swing components on pooled thread GitOrigin-RevId: 773b8bc167559b5e30840162421c36b0e7d49bc1 --- .../diff/merge/MergeRequestProcessor.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/platform/diff-impl/src/com/intellij/diff/merge/MergeRequestProcessor.java b/platform/diff-impl/src/com/intellij/diff/merge/MergeRequestProcessor.java index 1d03cd9d3456..0cca377bc01b 100644 --- a/platform/diff-impl/src/com/intellij/diff/merge/MergeRequestProcessor.java +++ b/platform/diff-impl/src/com/intellij/diff/merge/MergeRequestProcessor.java @@ -290,17 +290,20 @@ public abstract class MergeRequestProcessor implements Disposable { } private void showInvalidRequestNotification() { - if (!myNotificationPanel.isNull()) return; + ApplicationManager.getApplication().invokeLater(() -> { + if (myDisposed) return; + if (!myNotificationPanel.isNull()) return; - EditorNotificationPanel notification = new EditorNotificationPanel(LightColors.RED); - notification.setText("Conflict is not valid and no longer can be resolved."); - notification.createActionLabel("Abort Resolve", () -> { - applyRequestResult(MergeResult.CANCEL); - closeDialog(); - }); - myNotificationPanel.setContent(notification); - myMainPanel.validate(); - myMainPanel.repaint(); + EditorNotificationPanel notification = new EditorNotificationPanel(LightColors.RED); + notification.setText("Conflict is not valid and no longer can be resolved."); + notification.createActionLabel("Abort Resolve", () -> { + applyRequestResult(MergeResult.CANCEL); + closeDialog(); + }); + myNotificationPanel.setContent(notification); + myMainPanel.validate(); + myMainPanel.repaint(); + }, ModalityState.stateForComponent(myPanel)); } @Override