@Override
  public boolean iteration(@NotNull ProgressIndicator indicator) {
    final @Nullable Pair<CommonProblemDescriptor, Boolean> pair = nextDescriptor();
    if (pair == null) {
      return isDone();
    }

    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();
  }
@Override
  public boolean iteration(@NotNull ProgressIndicator indicator)