diff options
Diffstat (limited to 'java/java-impl/src/com/intellij/slicer/SliceUsage.java')
-rw-r--r-- | java/java-impl/src/com/intellij/slicer/SliceUsage.java | 10 |
1 files 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<SliceUsage> processor) { - final PsiElement element = getElement(); + final PsiElement element = ApplicationManager.getApplication().runReadAction(new Computable<PsiElement>() { + @Override + public PsiElement compute() { + return getElement(); + } + }); ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.checkCanceled(); |