From 1685ef97659d42a8b75dd26ff35dd0b1bdb85b05 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Tue, 19 Nov 2013 15:25:01 +0400 Subject: [PATCH] use Set for myEnabledDescriptors instead of List (as a side effect, not-thread-safe Set implementation is used, so there would be fewer locks) --- .../execution/testframework/autotest/AutoTestManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/autotest/AutoTestManager.java b/platform/testRunner/src/com/intellij/execution/testframework/autotest/AutoTestManager.java index 5a329508e4fe..822e9d186449 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/autotest/AutoTestManager.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/autotest/AutoTestManager.java @@ -13,9 +13,9 @@ import com.intellij.openapi.util.Key; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.content.Content; import com.intellij.util.Consumer; -import com.intellij.util.containers.WeakList; +import com.intellij.util.containers.WeakHashMap; -import java.util.Collection; +import java.util.Collections; import java.util.Set; /** @@ -29,7 +29,9 @@ public class AutoTestManager { private int myDelay; private DelayedDocumentWatcher myDocumentWatcher; - private final Collection myEnabledDescriptors = new WeakList(); + + // accessed only from EDT + private final Set myEnabledDescriptors = Collections.newSetFromMap(new WeakHashMap()); public static AutoTestManager getInstance(Project project) { return ServiceManager.getService(project, AutoTestManager.class);