diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java index 495f9a3eb37e..f632ddc1b543 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java @@ -24,6 +24,8 @@ import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.intellij.debugger.engine.events.DebuggerContextCommandImpl; import com.intellij.debugger.impl.DebuggerContextImpl; +import com.intellij.openapi.application.AccessToken; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; @@ -57,7 +59,13 @@ public abstract class EditorEvaluationCommand extends DebuggerContextCommandI protected abstract T evaluate(EvaluationContextImpl evaluationContext) throws EvaluateException; public T evaluate() throws EvaluateException { - myProgressIndicator.setText(DebuggerBundle.message("progress.evaluating", myElement.getText())); + AccessToken token = ReadAction.start(); + try { + myProgressIndicator.setText(DebuggerBundle.message("progress.evaluating", myElement.getText())); + } + finally { + token.finish(); + } try { T result = evaluate(myDebuggerContext.createEvaluationContext());