[freeze][dataflow from here] IDEA-268322 Freeze when Analyze Data Flow from Here

This patch restores the blocking read computation in JavaOverridingMethodsSearcher because the "nonBlocking()" call changes semantics of JavaOverridingMethodSearcher. Nonblocking made it be interrupted by write actions and everything became invalid in the middle of a computation, which might have affected the clients.

The analyze from/to here panel should be rewritten to the async model with the help from AsyncTreeModel.

GitOrigin-RevId: ed6864ba098724487f9836ecf880bbed60da0545
This commit is contained in:
Nikita Eshkeev
2021-05-25 14:14:55 +03:00
committed by intellij-monorepo-bot
parent fbd9397bf1
commit 17d84a1681

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.impl.search;
import com.intellij.ide.highlighter.JavaFileType;
@@ -113,7 +113,7 @@ public class JavaOverridingMethodsSearcher implements QueryExecutor<PsiMethod, O
assert containingClass != null;
Collection<PsiMethod> result = new HashSet<>();
Processor<PsiClass> inheritorsProcessor = inheritor -> {
PsiMethod found = ReadAction.nonBlocking(() -> findOverridingMethod(inheritor, method, containingClass)).executeSynchronously();
PsiMethod found = ReadAction.compute(() -> findOverridingMethod(inheritor, method, containingClass));
if (found != null) {
synchronized (result) {
result.add(found);