diff options
Diffstat (limited to 'java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java')
-rw-r--r-- | java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java index ece2108b072c..933998344add 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java @@ -1,5 +1,22 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.psi.impl.search; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.util.Computable; import com.intellij.psi.PsiMethod; import com.intellij.util.Processor; import com.intellij.util.QueryExecutor; @@ -23,12 +40,17 @@ public class MethodDeepestSuperSearcher implements QueryExecutor<PsiMethod, PsiM return findDeepestSuperOrSelfSignature(method, methods, null, consumer); } - private static boolean findDeepestSuperOrSelfSignature(PsiMethod method, + private static boolean findDeepestSuperOrSelfSignature(final PsiMethod method, Set<PsiMethod> set, Set<PsiMethod> guard, Processor<PsiMethod> processor) { if (guard != null && !guard.add(method)) return true; - PsiMethod[] supers = method.findSuperMethods(); + PsiMethod[] supers = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod[]>() { + @Override + public PsiMethod[] compute() { + return method.findSuperMethods(); + } + }); if (supers.length == 0 && set.add(method) && !processor.process(method)) { return false; |