From 075256eb89cee9161eeced8b5cb34a99ffe024fc Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 1 Mar 2019 07:36:23 +0100 Subject: [PATCH] DumbService: remove confusing logger, deprecate repeatUntilPassesInSmartMode --- .../com/intellij/openapi/project/DumbService.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/project/DumbService.java b/platform/core-api/src/com/intellij/openapi/project/DumbService.java index a82fe1289cb0..d12a98f9840c 100644 --- a/platform/core-api/src/com/intellij/openapi/project/DumbService.java +++ b/platform/core-api/src/com/intellij/openapi/project/DumbService.java @@ -6,7 +6,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.components.ServiceManager; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.extensions.ProjectExtensionPointName; import com.intellij.openapi.progress.ProcessCanceledException; @@ -30,7 +29,6 @@ import java.util.List; * @author peter */ public abstract class DumbService { - private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.project.DumbService"); /** * @see Project#getMessageBus() @@ -85,7 +83,7 @@ public abstract class DumbService { /** * Pause the current thread until dumb mode ends and then continue execution. * NOTE: there are no guarantees that a new dumb mode won't begin before the next statement. - * Hence: use with care. Consider using {@link #runWhenSmart(Runnable)}, {@link #runReadActionInSmartMode(Runnable)} or {@link #repeatUntilPassesInSmartMode(Runnable)} instead + * Hence: use with care. Consider using {@link #runWhenSmart(Runnable)} or {@link #runReadActionInSmartMode(Runnable)} instead */ public abstract void waitForSmartMode(); @@ -152,11 +150,9 @@ public abstract class DumbService { /** * Pause the current thread until dumb mode ends, and then attempt to execute the runnable. If it fails due to another dumb mode having started, * try again until the runnable can complete successfully. - * It makes sense to use this method when you have a long-running activity consisting of many small read actions, and you don't want to - * use a single long read action to keep the IDE responsive. - * - * @see #runReadActionInSmartMode(Runnable) + * This method provides no guarantees and should be avoided, please use {@link #runReadActionInSmartMode} instead. */ + @Deprecated public void repeatUntilPassesInSmartMode(@NotNull final Runnable r) { while (true) { waitForSmartMode(); @@ -164,8 +160,7 @@ public abstract class DumbService { r.run(); return; } - catch (IndexNotReadyException e) { - LOG.info(e); + catch (IndexNotReadyException ignored) { } } }