boolean (@NotNull ProgressIndicator indicator) { final Pair<CommonProblemDescriptor, Boolean> pair = nextDescriptor(); CommonProblemDescriptor descriptor = pair.getFirst(); boolean shouldDoPostponedOperations = pair.getSecond(); beforeProcessing(descriptor); indicator.setFraction((double)myProcessed++ / myLength); String presentableText = notNullize(getPresentableText(descriptor), "usages"); indicator.setText(InspectionsBundle.message("processing.progress.text", presentableText)); boolean runInReadAction = mustRunInReadAction(descriptor); ApplicationManager.getApplication().runWriteAction(() -> { myDocumentManager.commitAllDocuments(); if (!runInReadAction) { applyFix(myProject, descriptor); if (shouldDoPostponedOperations) { myReformattingAspect.doPostponedFormatting(); } } }); if (runInReadAction) { applyFix(myProject, descriptor); } return isDone(); }