From 4b0f968ca9256786fa3cac2db2636643ce6c1154 Mon Sep 17 00:00:00 2001 From: irengrig Date: Wed, 4 May 2011 14:25:55 +0400 Subject: [PATCH] IDEA-69118 Perforce: don't add new NotLoggedToPerforce notification on each Refresh pressing in Inspect PerforceConfigurationState dialog (cherry picked from commit fb4784e2d9358a73d917fdf8680b1909fefdfaa5) --- .../openapi/vcs/impl/GenericNotifierImpl.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java index 14ee0f4cd09b..27124e539ab1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java @@ -81,15 +81,6 @@ public abstract class GenericNotifierImpl { final Application application = ApplicationManager.getApplication(); final Runnable runnable = new Runnable() { public void run() { - final Iterator> iterator = notifications.iterator(); - while (iterator.hasNext()) { - final MyNotification notification = iterator.next(); - synchronized (myLock) { - if (myState.containsKey(getKey(notification.getObj()))) { - iterator.remove(); - } - } - } for (MyNotification notification : notifications) { notification.expire(); } @@ -106,11 +97,6 @@ public abstract class GenericNotifierImpl { final Application application = ApplicationManager.getApplication(); final Runnable runnable = new Runnable() { public void run() { - synchronized (myLock) { - if (myState.containsKey(getKey(notification.getObj()))) { - return; - } - } notification.expire(); } }; @@ -138,7 +124,7 @@ public abstract class GenericNotifierImpl { application.invokeLater(new Runnable() { public void run() { synchronized (myLock) { - if (! myState.containsKey(getKey(notification.getObj()))) return; + if (notification.isExpired() || ! myState.containsKey(getKey(notification.getObj()))) return; } Notifications.Bus.notify(notification, NotificationDisplayType.STICKY_BALLOON, myProject); }