implicit to string search: check method before search (wrap with read action)

This commit is contained in:
Dmitry Batkovich
2018-04-25 13:36:23 +03:00
parent 3d5412f05e
commit 1bcff3a63e
@@ -182,7 +182,7 @@ public class JavaFindUsagesHelper {
FunctionalExpressionSearch.search(psiMethod, methodOptions.searchScope).forEach(new PsiElementProcessorAdapter<>(
expression -> addResult(expression, options, processor)));
}
if (ImplicitToStringSearch.isToStringMethod(psiMethod) && methodOptions.isImplicitToString) {
if (ReadAction.compute(() -> ImplicitToStringSearch.isToStringMethod(psiMethod)) && methodOptions.isImplicitToString) {
ImplicitToStringSearch.search(psiMethod, methodOptions.searchScope).forEach(new PsiElementProcessorAdapter<>(ref -> addResult(ref, options, processor)));
}
}