From df4bbcb608addd04bf9f3f5e29d0117afd3458d1 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 1 Mar 2019 02:41:01 +0300 Subject: [PATCH] cleanup: avoid creating Future unnecessarily --- .../com/intellij/openapi/vfs/newvfs/RefreshQueueImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshQueueImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshQueueImpl.java index 00ff57e020dd..296edf3b41f4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshQueueImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshQueueImpl.java @@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.ide.PooledThreadExecutor; import java.util.Collections; -import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executor; /** * @author max @@ -39,7 +39,7 @@ import java.util.concurrent.ExecutorService; public class RefreshQueueImpl extends RefreshQueue implements Disposable { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.newvfs.RefreshQueueImpl"); - private final ExecutorService myQueue = AppExecutorUtil.createBoundedApplicationPoolExecutor("RefreshQueue Pool", PooledThreadExecutor.INSTANCE, 1, this); + private final Executor myQueue = AppExecutorUtil.createBoundedApplicationPoolExecutor("RefreshQueue Pool", PooledThreadExecutor.INSTANCE, 1, this); private final ProgressIndicator myRefreshIndicator = RefreshProgress.create(VfsBundle.message("file.synchronize.progress")); private final TLongObjectHashMap mySessions = new TLongObjectHashMap<>(); private final FrequentEventDetector myEventCounter = new FrequentEventDetector(100, 100, FrequentEventDetector.Level.WARN); @@ -68,7 +68,7 @@ public class RefreshQueueImpl extends RefreshQueue implements Disposable { } private void queueSession(@NotNull RefreshSessionImpl session, @Nullable TransactionId transaction) { - myQueue.submit(() -> { + myQueue.execute(() -> { myRefreshIndicator.start(); try (AccessToken ignored = HeavyProcessLatch.INSTANCE.processStarted("Doing file refresh. " + session)) { doScan(session);