diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java index 81a3d64d672d..a7697446e94f 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java @@ -211,7 +211,7 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler { ActionContext actionContext = ActionContext.from(editor, psiFile); ThrowableComputable computable = () -> ReadAction.nonBlocking(() -> modCommand.getPresentation(actionContext) != null) - .expireWhen(() -> project.isDisposed()) + .expireWith(project) .executeSynchronously(); return ProgressManager.getInstance().runProcessWithProgressSynchronously( computable, LangBundle.message("command.check.availability.for", modCommand.getFamilyName()), true, project); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionUtilImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionUtilImpl.java index a486f648ebf8..7a493cf29a70 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionUtilImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/CleanupInspectionUtilImpl.java @@ -95,7 +95,7 @@ public final class CleanupInspectionUtilImpl implements CleanupInspectionUtil { if (batchFix instanceof ModCommandBatchQuickFix modCommandBatchQuickFix) { ThrowableComputable actionComputable = () -> ReadAction.nonBlocking(() -> modCommandBatchQuickFix.perform(myProject, myBatchModeDescriptors)) - .expireWhen(() -> myProject.isDisposed()) + .expireWith(myProject) .executeSynchronously(); ModCommand command = ProgressManager.getInstance().runProcessWithProgressSynchronously( actionComputable, LangBundle.message("apply.fixes"), true, myProject);