Program: 110994
Project: 110994
Buggy source:
/** 
 * Returns the path and file state of   {@code rootedPath}, accounting for ancestor symlinks, or  {@code null} if there was a missing dep.
 */
@Nullable private Pair<RootedPath,FileStateValue> resolveFromAncestors(RootedPath rootedPath,Environment env) throws FileFunctionException {
  PathFragment relativePath=rootedPath.getRelativePath();
  RootedPath realRootedPath=rootedPath;
  FileValue parentFileValue=null;
  if (!externalFilesHelper.shouldAssumeImmutable(rootedPath) && !relativePath.equals(PathFragment.EMPTY_FRAGMENT)) {
    RootedPath parentRootedPath=RootedPath.toRootedPath(rootedPath.getRoot(),relativePath.getParentDirectory());
    parentFileValue=(FileValue)env.getValue(FileValue.key(parentRootedPath));
    if (parentFileValue == null) {
      return null;
    }
    PathFragment baseName=new PathFragment(relativePath.getBaseName());
    RootedPath parentRealRootedPath=parentFileValue.realRootedPath();
    realRootedPath=RootedPath.toRootedPath(parentRealRootedPath.getRoot(),parentRealRootedPath.getRelativePath().getRelative(baseName));
    if (!parentFileValue.exists()) {
      return Pair.of(realRootedPath,FileStateValue.NONEXISTENT_FILE_STATE_NODE);
    }
  }
  FileStateValue realFileStateValue=(FileStateValue)env.getValue(FileStateValue.key(realRootedPath));
  if (realFileStateValue == null) {
    return null;
  }
  if (realFileStateValue.getType() != FileStateValue.Type.NONEXISTENT && parentFileValue != null && !parentFileValue.isDirectory()) {
    String type=realFileStateValue.getType().toString().toLowerCase();
    String message=type + "String_Node_Str" + rootedPath.asPath()+ "String_Node_Str"+ "String_Node_Str"+ parentFileValue.realRootedPath().asPath()+ "String_Node_Str";
    throw new FileFunctionException(new InconsistentFilesystemException(message),Transience.TRANSIENT);
  }
  return Pair.of(realRootedPath,realFileStateValue);
}

Fixed version (ground truth):
/** 
 * Returns the path and file state of   {@code rootedPath}, accounting for ancestor symlinks, or  {@code null} if there was a missing dep.
 */
@Nullable private Pair<RootedPath,FileStateValue> resolveFromAncestors(RootedPath rootedPath,Environment env) throws FileFunctionException {
  PathFragment relativePath=rootedPath.getRelativePath();
  RootedPath realRootedPath=rootedPath;
  FileValue parentFileValue=null;
  if (!externalFilesHelper.shouldAssumeImmutable(rootedPath) && !relativePath.equals(PathFragment.EMPTY_FRAGMENT)) {
    RootedPath parentRootedPath=RootedPath.toRootedPath(rootedPath.getRoot(),relativePath.getParentDirectory());
    parentFileValue=(FileValue)env.getValue(FileValue.key(parentRootedPath));
    if (parentFileValue == null) {
      return null;
    }
    PathFragment baseName=new PathFragment(relativePath.getBaseName());
    RootedPath parentRealRootedPath=parentFileValue.realRootedPath();
    realRootedPath=RootedPath.toRootedPath(parentRealRootedPath.getRoot(),parentRealRootedPath.getRelativePath().getRelative(baseName));
    if (!parentFileValue.exists()) {
      return Pair.<RootedPath,FileStateValue>of(realRootedPath,FileStateValue.NONEXISTENT_FILE_STATE_NODE);
    }
  }
  FileStateValue realFileStateValue=(FileStateValue)env.getValue(FileStateValue.key(realRootedPath));
  if (realFileStateValue == null) {
    return null;
  }
  if (realFileStateValue.getType() != FileStateValue.Type.NONEXISTENT && parentFileValue != null && !parentFileValue.isDirectory()) {
    String type=realFileStateValue.getType().toString().toLowerCase();
    String message=type + "String_Node_Str" + rootedPath.asPath()+ "String_Node_Str"+ "String_Node_Str"+ parentFileValue.realRootedPath().asPath()+ "String_Node_Str";
    throw new FileFunctionException(new InconsistentFilesystemException(message),Transience.TRANSIENT);
  }
  return Pair.of(realRootedPath,realFileStateValue);
}