From 263b4dece7ac1adf492131cd42d5ea2f332ee81b Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Tue, 2 May 2017 16:54:49 +0300 Subject: [PATCH] ES: possible project leak fix --- .../notification/ExternalSystemNotificationManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java index 0b811f1f0f11..9f72b4a225cd 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java @@ -156,6 +156,8 @@ public class ExternalSystemNotificationManager implements Disposable { public void showNotification(@NotNull final ProjectSystemId externalSystemId, @NotNull final NotificationData notificationData, @Nullable Key notificationKey) { + if(ApplicationManager.getApplication().isUnitTestMode()) return; + if (notificationKey != null && isNotificationActive(notificationKey)) return; myUpdater.submit(() -> { if (myProject.isDisposed()) return; @@ -221,6 +223,8 @@ public class ExternalSystemNotificationManager implements Disposable { @NotNull final NotificationSource notificationSource, @NotNull final ProjectSystemId externalSystemId) { myMessageCounter.remove(groupName, notificationSource, externalSystemId); + if(ApplicationManager.getApplication().isUnitTestMode()) return; + myUpdater.submit(() -> { if (myProject.isDisposed()) return; for (Iterator iterator = myNotifications.iterator(); iterator.hasNext(); ) {