public void checkUpToDate(@NotNull CompileScope scope) {
    CompileContextImpl context = createContext(scope);
    try {
      final BuildFSState fsState = myProjectDescriptor.fsState;

      ExecutorService executor = AppExecutorUtil.createBoundedApplicationPoolExecutor("IncProjectBuilder Check UpToDate Pool", SharedThreadPool.getInstance(), MAX_BUILDER_THREADS);
      List<Future<?>> tasks = new ArrayList<>();

      var notifier = new Object() {
        private final AtomicBoolean hasWorkToDo = new AtomicBoolean(false);

        boolean hasChanges() {
          return hasWorkToDo.get();
        }

        void signalHasChanges() {
          if (!hasWorkToDo.getAndSet(true)) {
            // this will serve as a marker that compiler has work to do
            myMessageDispatcher.processMessage(DoneSomethingNotification.INSTANCE);
          }
        }
      };

      for (BuildTarget<?> target : myProjectDescriptor.getBuildTargetIndex().getAllTargets()) {
        if (notifier.hasChanges()) {
          break;
        }
        if (scope.isAffected(target)) {
          tasks.add(executor.submit(() -> {
            try {
              if (notifier.hasChanges()) {
                return;
              }
              if (context.getCancelStatus().isCanceled()) {
                notifier.signalHasChanges(); // unable to check all targets => assume has changes
                return;
              }
              BuildOperations.ensureFSStateInitialized(context, target, true);
              final FilesDelta delta = fsState.getEffectiveFilesDelta(context, target);
              delta.lockData();
              try {
                for (Set<File> files : delta.getSourcesToRecompile().values()) {
                  for (File file : files) {
                    if (scope.isAffected(target, file)) {
                      notifier.signalHasChanges();
                      return;
                    }
                  }
                }
              }
              finally {
                delta.unlockData();
              }
            }
            catch (Throwable e) {
              LOG.info(e);
              notifier.signalHasChanges(); // data can be corrupted => rebuild required => has changes
            }
          }));
        }
      }

      for (Future<?> task : tasks) {
        try {
          task.get();
        }
        catch (Throwable e) {
          LOG.info(e);
        }
      }
    }
    finally {
      flushContext(context);
    }
  }
public void checkUpToDate(@NotNull CompileScope scope)