@Override
  protected void finishTask(@NotNull Task task,
                            boolean canceled,
                            @Nullable Throwable error) {
    ProgressManagerListener listener = getProjectManagerListener();
    try {
      listener.beforeTaskFinished(task);
    }
    finally {
      try {
        super.finishTask(task, canceled, error);
      }
      finally {
        listener.afterTaskFinished(task);
      }
    }
  }
@Override
  protected void finishTask(@NotNull Task task,
                            boolean canceled,
                            @Nullable Throwable error)