Program: 52969
Project: 52969
Buggy source:
private synchronized void record(Path relPath,Optional<String> memRelPath,HashCode hashCode,List<PathWithUnixSeparators> children){
  LOG.verbose("String_Node_Str",projectFilesystem.resolve(relPath).toAbsolutePath());
  Optional<Path> pathRelativeToProjectRoot=projectFilesystem.getPathRelativeToProjectRoot(relPath);
  BuildJobStateFileHashEntry fileHashEntry=new BuildJobStateFileHashEntry();
  boolean pathIsAbsolute=allRecordedPathsAreAbsolute;
  fileHashEntry.setPathIsAbsolute(pathIsAbsolute);
  Path entryKey=pathIsAbsolute ? projectFilesystem.resolve(relPath).toAbsolutePath() : pathRelativeToProjectRoot.get();
  boolean isDirectory=projectFilesystem.isDirectory(relPath);
  Path realPath=findRealPath(relPath);
  boolean realPathInsideProject=projectFilesystem.getPathRelativeToProjectRoot(realPath).isPresent();
  if (!realPathInsideProject && !pathIsAbsolute) {
    Pair<Path,Path> symLinkRootAndTarget=findSymlinkRoot(projectFilesystem.resolve(relPath).toAbsolutePath());
    Path symLinkRoot=projectFilesystem.getPathRelativeToProjectRoot(symLinkRootAndTarget.getFirst()).get();
    fileHashEntry.setRootSymLink(new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(symLinkRoot)));
    fileHashEntry.setRootSymLinkTarget(new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(symLinkRootAndTarget.getSecond().toAbsolutePath())));
  }
  fileHashEntry.setIsDirectory(isDirectory);
  fileHashEntry.setHashCode(hashCode.toString());
  fileHashEntry.setPath(new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(entryKey)));
  if (memRelPath.isPresent()) {
    fileHashEntry.setArchiveMemberPath(memRelPath.get().toString());
  }
  if (!isDirectory && !pathIsAbsolute && realPathInsideProject) {
    try {
      Path absPath=projectFilesystem.resolve(relPath).toAbsolutePath();
      fileHashEntry.setContents(Files.readAllBytes(absPath));
      fileHashEntry.setIsExecutable(absPath.toFile().canExecute());
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (isDirectory && !pathIsAbsolute && realPathInsideProject) {
    fileHashEntry.setChildren(children);
  }
  fileHashEntry.setMaterializeDuringPreloading(materializeCurrentFileDuringPreloading);
  remoteFileHashes.addEntry(fileHashEntry);
}

Fixed version (ground truth):
private synchronized void record(Path relPath,Optional<String> memRelPath,HashCode hashCode,List<PathWithUnixSeparators> children){
  LOG.verbose("String_Node_Str",projectFilesystem.resolve(relPath).toAbsolutePath());
  Optional<Path> pathRelativeToProjectRoot=projectFilesystem.getPathRelativeToProjectRoot(relPath);
  BuildJobStateFileHashEntry fileHashEntry=new BuildJobStateFileHashEntry();
  boolean pathIsAbsolute=allRecordedPathsAreAbsolute;
  fileHashEntry.setPathIsAbsolute(pathIsAbsolute);
  Path entryKey=pathIsAbsolute ? projectFilesystem.resolve(relPath).toAbsolutePath() : pathRelativeToProjectRoot.get();
  boolean isDirectory=projectFilesystem.isDirectory(relPath);
  Path realPath=findRealPath(relPath);
  boolean realPathInsideProject=projectFilesystem.getPathRelativeToProjectRoot(realPath).isPresent();
  if (!realPathInsideProject && !pathIsAbsolute) {
    Pair<Path,Path> symLinkRootAndTarget=findSymlinkRoot(projectFilesystem.resolve(relPath).toAbsolutePath());
    Path symLinkRoot=projectFilesystem.getPathRelativeToProjectRoot(symLinkRootAndTarget.getFirst()).get();
    fileHashEntry.setRootSymLink(new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(symLinkRoot)));
    fileHashEntry.setRootSymLinkTarget(new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(symLinkRootAndTarget.getSecond().toAbsolutePath())));
  }
  fileHashEntry.setIsDirectory(isDirectory);
  fileHashEntry.setHashCode(hashCode.toString());
  fileHashEntry.setPath(new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(entryKey)));
  if (memRelPath.isPresent()) {
    fileHashEntry.setArchiveMemberPath(memRelPath.get().toString());
  }
  if (!isDirectory && !pathIsAbsolute && realPathInsideProject) {
    try {
      Path absPath=projectFilesystem.resolve(relPath).toAbsolutePath();
      fileHashEntry.setContents(Files.readAllBytes(absPath));
      fileHashEntry.setIsExecutable(absPath.toFile().canExecute());
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
 else   if (isDirectory && !pathIsAbsolute && realPathInsideProject) {
    fileHashEntry.setChildren(children);
  }
  fileHashEntry.setMaterializeDuringPreloading(materializeCurrentFileDuringPreloading);
  remoteFileHashes.addEntry(fileHashEntry);
}