@Override
  protected void reportFileWrittenToIndex(FileInAST file, IIndexFragmentFile ifile)
      throws CoreException {
    final FileContentKey fck = file.fileContentKey;
    final IIndexFileLocation location = fck.getLocation();
    boolean wasCounted = false;
    UpdateKind kind = UpdateKind.OTHER_HEADER;
    LinkageTask map = findRequestMap(fck.getLinkageID());
    LocationTask locTask = null;
    if (map != null) {
      locTask = map.find(location);
      if (locTask != null) {
        kind = locTask.fKind;
        FileVersionTask v = locTask.findVersion(ifile);
        if (v != null) {
          wasCounted = v.fOutdated;
          v.setUpdated();
        } else {
          // We have added a version, the request is fulfilled.
          wasCounted = locTask.fCountedUnknownVersion;
          locTask.fCountedUnknownVersion = false;
        }
        locTask.fStoredAVersion = true;
      }
    }
    fIndexContentCache.remove(ifile);
    fIndexFilesCache.remove(file.fileContentKey.getLocation());

    LocationTask task = fOneLinkageTasks.remove(location);
    if (task != null && task != locTask) {
      if (task.fKind == UpdateKind.ONE_LINKAGE_HEADER && !task.isCompleted()) {
        task.fKind = UpdateKind.OTHER_HEADER;
        if (task.isCompleted()) {
          if (!wasCounted) {
            kind = UpdateKind.ONE_LINKAGE_HEADER;
            wasCounted = true;
          } else {
            reportFile(wasCounted, UpdateKind.ONE_LINKAGE_HEADER);
          }
        }
      }
    }
    reportFile(wasCounted, kind);
  }