diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index ec45dc1d1a97..fd128febf667 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -659,7 +659,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp } createViewIfNeed(); if (!myView.isDisposed()) { - ReadAction.run(() -> myView.addTools(globalTools)); + myView.addTools(globalTools); } } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java index d7869e2f9cfe..6c3216b019d8 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -39,6 +39,7 @@ import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.colors.EditorColors; @@ -367,7 +368,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren private JComponent createToolbar(final DefaultActionGroup specialGroup) { final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CODE_INSPECTION, specialGroup, false); - toolbar.setTargetComponent(this); + //toolbar.setTargetComponent(this); return toolbar.getComponent(); } @@ -670,7 +671,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren if (app.isUnitTestMode()) { buildAction.run(); } else { - app.executeOnPooledThread(() -> app.runReadAction(buildAction)); + app.executeOnPooledThread(buildAction); } } @@ -721,12 +722,15 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren final HighlightDisplayKey key = HighlightDisplayKey.find(defaultToolWrapper.getShortName()); for (ScopeToolState state : myProvider.getTools(currentTools)) { InspectionToolWrapper toolWrapper = state.getTool(); - if (myProvider.checkReportedProblems(myGlobalInspectionContext, toolWrapper)) { - addTool(toolWrapper, - profile.getErrorLevel(key, state.getScope(myProject), myProject), - isGroupedBySeverity, - singleInspectionRun); - } + LOG.assertTrue(!ApplicationManager.getApplication().isReadAccessAllowed()); + ReadAction.run(() -> { + if (myProvider.checkReportedProblems(myGlobalInspectionContext, toolWrapper)) { + addTool(toolWrapper, + profile.getErrorLevel(key, state.getScope(myProject), myProject), + isGroupedBySeverity, + singleInspectionRun); + } + }); } } }