public boolean markAllUpToDate(CompileContext context, final BuildRootDescriptor rd, final StampsStorage stampsStorage) throws IOException {
    boolean marked = false;
    final BuildTarget<?> target = rd.getTarget();
    final FilesDelta delta = getDelta(target);
    final long targetBuildStartStamp = context.getCompilationStartStamp(target);
    // prevent modifications to the data structure from external FS events
    delta.lockData();
    try {
      final Set<File> files = delta.clearRecompile(rd);
      if (files != null) {
        CompileScope scope = context.getScope();
        for (File file : files) {
          if (scope.isAffected(target, file)) {
            final long currentFileTimestamp = FSOperations.lastModified(file);
            StampsStorage.Stamp stamp = stampsStorage.getCurrentStamp(file);
            if (!rd.isGenerated() && (currentFileTimestamp > targetBuildStartStamp || getEventRegistrationStamp(file) > targetBuildStartStamp)) {
              // if the file was modified after the compilation had started,
              // do not save the stamp considering file dirty
              // Important!
              // Event registration stamp check is essential for the files that were actually changed _before_ targetBuildStart,
              // but corresponding change event was received and processed _after_ targetBuildStart
              if (Utils.IS_TEST_MODE) {
                LOG.info("Timestamp after compilation started; marking dirty again: " + file.getPath());
              }
              delta.markRecompile(rd, file);
            }
            else {
              marked = true;
              stampsStorage.saveStamp(file, target, stamp); // todo: ask jeka
            }
          }
          else {
            if (Utils.IS_TEST_MODE) {
              LOG.info("Not affected by compile scope; marking dirty again: " + file.getPath());
            }
            delta.markRecompile(rd, file);
          }
        }
      }
      return marked;
    }
    finally {
      delta.unlockData();
    }
  }
public boolean markAllUpToDate(CompileContext context, final BuildRootDescriptor rd, final StampsStorage stampsStorage)