From 0dd71c4723d5e889bfabed526a8efbc5506ddc71 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 25 Aug 2014 19:31:01 +0400 Subject: [PATCH] read action --- java/java-impl/src/com/intellij/slicer/SliceUsage.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/slicer/SliceUsage.java b/java/java-impl/src/com/intellij/slicer/SliceUsage.java index b8d5a34c3c61..ef68b0d6a28e 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceUsage.java +++ b/java/java-impl/src/com/intellij/slicer/SliceUsage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import com.intellij.analysis.AnalysisScope; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; +import com.intellij.openapi.util.Computable; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiSubstitutor; import com.intellij.usageView.UsageInfo; @@ -68,7 +69,12 @@ public class SliceUsage extends UsageInfo2UsageAdapter { } public void processChildren(@NotNull Processor processor) { - final PsiElement element = getElement(); + final PsiElement element = ApplicationManager.getApplication().runReadAction(new Computable() { + @Override + public PsiElement compute() { + return getElement(); + } + }); ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.checkCanceled();