summaryrefslogtreecommitdiff
path: root/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java')
-rw-r--r--java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java42
1 files changed, 32 insertions, 10 deletions
diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java
index d65e80e7f997..acb5faae4947 100644
--- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java
+++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java
@@ -1,6 +1,23 @@
+/*
+ * 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.diagnostic.Logger;
+import com.intellij.openapi.util.Computable;
import com.intellij.psi.*;
import com.intellij.psi.search.searches.SuperMethodsSearch;
import com.intellij.psi.util.InheritanceUtil;
@@ -22,18 +39,23 @@ public class MethodSuperSearcher implements QueryExecutor<MethodSignatureBackedB
public boolean execute(@NotNull final SuperMethodsSearch.SearchParameters queryParameters, @NotNull final Processor<MethodSignatureBackedByPsiMethod> consumer) {
final PsiClass parentClass = queryParameters.getPsiClass();
final PsiMethod method = queryParameters.getMethod();
- HierarchicalMethodSignature signature = method.getHierarchicalMethodSignature();
+ return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
+ @Override
+ public Boolean compute() {
+ HierarchicalMethodSignature signature = method.getHierarchicalMethodSignature();
- final boolean checkBases = queryParameters.isCheckBases();
- final boolean allowStaticMethod = queryParameters.isAllowStaticMethod();
- final List<HierarchicalMethodSignature> supers = signature.getSuperSignatures();
- for (HierarchicalMethodSignature superSignature : supers) {
- if (MethodSignatureUtil.isSubsignature(superSignature, signature)) {
- if (!addSuperMethods(superSignature, method, parentClass, allowStaticMethod, checkBases, consumer)) return false;
- }
- }
+ final boolean checkBases = queryParameters.isCheckBases();
+ final boolean allowStaticMethod = queryParameters.isAllowStaticMethod();
+ final List<HierarchicalMethodSignature> supers = signature.getSuperSignatures();
+ for (HierarchicalMethodSignature superSignature : supers) {
+ if (MethodSignatureUtil.isSubsignature(superSignature, signature)) {
+ if (!addSuperMethods(superSignature, method, parentClass, allowStaticMethod, checkBases, consumer)) return false;
+ }
+ }
- return true;
+ return true;
+ }
+ });
}
private static boolean addSuperMethods(final HierarchicalMethodSignature signature,