nus-yam/ex-repair huggingface dataset:
Program: 110570
Project: 110570
Buggy source:
@Override protected Iterable<Task> getVisitTasks(Collection<Pair<SkyKey,SkyKey>> pendingKeysToVisit){
  ListMultimap<PackageIdentifier,Pair<SkyKey,SkyKey>> visitsByPackage=ArrayListMultimap.create();
  for (  Pair<SkyKey,SkyKey> visit : pendingKeysToVisit) {
    Label label=SkyQueryEnvironment.SKYKEY_TO_LABEL.apply(visit.second);
    if (label != null) {
      visitsByPackage.put(label.getPackageIdentifier(),visit);
    }
  }
  ImmutableList.Builder<Task> builder=ImmutableList.builder();
  for (  Iterable<Pair<SkyKey,SkyKey>> keysToVisitBatch : Iterables.partition(ImmutableList.copyOf(visitsByPackage.values()),VISIT_BATCH_SIZE)) {
    builder.add(new VisitTask(keysToVisitBatch));
  }
  return builder.build();
}

Fixed version (ground truth):
@Override protected Iterable<Task> getVisitTasks(Collection<DepAndRdep> pendingKeysToVisit){
  ListMultimap<PackageIdentifier,DepAndRdep> visitsByPackage=ArrayListMultimap.create();
  for (  DepAndRdep depAndRdep : pendingKeysToVisit) {
    Label label=SkyQueryEnvironment.SKYKEY_TO_LABEL.apply(depAndRdep.rdep);
    if (label != null) {
      visitsByPackage.put(label.getPackageIdentifier(),depAndRdep);
    }
  }
  ImmutableList.Builder<Task> builder=ImmutableList.builder();
  for (  Iterable<DepAndRdep> depAndRdepBatch : Iterables.partition(ImmutableList.copyOf(visitsByPackage.values()),VISIT_BATCH_SIZE)) {
    builder.add(new VisitTask(depAndRdepBatch));
  }
  return builder.build();
}
Program: 110571
Project: 110571
Buggy source:
private Factory(SkyQueryEnvironment env,Callback<Target> callback,MultisetSemaphore<PackageIdentifier> packageSemaphore){
  this.env=env;
  this.uniquifier=env.createReverseDepSkyKeyUniquifier();
  this.callback=callback;
  this.packageSemaphore=packageSemaphore;
}

Fixed version (ground truth):
private Factory(SkyQueryEnvironment env,Callback<Target> callback,MultisetSemaphore<PackageIdentifier> packageSemaphore){
  this.env=env;
  this.depAndRdepUniquifier=new UniquifierImpl<>(depAndRdep -> depAndRdep);
  this.validRdepUniquifier=env.createSkyKeyUniquifier();
  this.callback=callback;
  this.packageSemaphore=packageSemaphore;
}
Program: 110572
Project: 110572
Buggy source:
@Override public ParallelVisitor<Pair<SkyKey,SkyKey>,Target> create(){
  return new AllRdepsUnboundedVisitor(env,uniquifier,callback,packageSemaphore);
}

Fixed version (ground truth):
@Override public ParallelVisitor<DepAndRdep,Target> create(){
  return new AllRdepsUnboundedVisitor(env,depAndRdepUniquifier,validRdepUniquifier,callback,packageSemaphore);
}
Program: 110574
Project: 110574
Buggy source:
private AllRdepsUnboundedVisitor(SkyQueryEnvironment env,Uniquifier<Pair<SkyKey,SkyKey>> uniquifier,Callback<Target> callback,MultisetSemaphore<PackageIdentifier> packageSemaphore){
  super(uniquifier,callback,VISIT_BATCH_SIZE,PROCESS_RESULTS_BATCH_SIZE);
  this.env=env;
  this.packageSemaphore=packageSemaphore;
}

Fixed version (ground truth):
private AllRdepsUnboundedVisitor(SkyQueryEnvironment env,Uniquifier<DepAndRdep> depAndRdepUniquifier,Uniquifier<SkyKey> validRdepUniquifier,Callback<Target> callback,MultisetSemaphore<PackageIdentifier> packageSemaphore){
  super(callback,VISIT_BATCH_SIZE,PROCESS_RESULTS_BATCH_SIZE);
  this.env=env;
  this.depAndRdepUniquifier=depAndRdepUniquifier;
  this.validRdepUniquifier=validRdepUniquifier;
  this.packageSemaphore=packageSemaphore;
}
Program: 110575
Project: 110575
Buggy source:
/** 
 * Filters this object.
 * @return an optional wrapping a = new {@link AndroidResources} with resources filtered by thepassed  {@link ResourceFilter}, or   {@link Optional#empty()} if no resources should befiltered.
 */
public Optional<AndroidResources> maybeFilter(ResourceFilter resourceFilter,boolean isDependency){
  Optional<ImmutableList<Artifact>> filtered=resourceFilter.maybeFilter(resources,isDependency);
  if (!filtered.isPresent()) {
    return Optional.empty();
  }
  ImmutableList.Builder<PathFragment> filteredResourcesRootsBuilder=ImmutableList.builder();
  for (  PathFragment resourceRoot : resourceRoots) {
    for (    Artifact resource : filtered.get()) {
      if (resource.getRootRelativePath().startsWith(resourceRoot)) {
        filteredResourcesRootsBuilder.add(resourceRoot);
        break;
      }
    }
  }
  return Optional.of(new AndroidResources(filtered.get(),filteredResourcesRootsBuilder.build()));
}

Fixed version (ground truth):
/** 
 * Filters this object.
 * @return an optional wrapping a = new {@link AndroidResources} with resources filtered by thepassed  {@link ResourceFilter}, or   {@link Optional#empty()} if no resources should befiltered.
 */
public Optional<AndroidResources> maybeFilter(RuleErrorConsumer errorConsumer,ResourceFilter resourceFilter,boolean isDependency) throws RuleErrorException {
  Optional<ImmutableList<Artifact>> filtered=resourceFilter.maybeFilter(resources,isDependency);
  if (!filtered.isPresent()) {
    return Optional.empty();
  }
  return Optional.of(new AndroidResources(filtered.get(),getResourceRoots(errorConsumer,filtered.get(),DEFAULT_RESOURCES_ATTR)));
}
Program: 110576
Project: 110576
Buggy source:
/** 
 * Filters this object, assuming it contains the resources of the current target. <p>If this object contains the resources from a dependency of this target, use   {@link #maybeFilter(ResourceFilter,boolean)} instead.
 * @return a filtered {@link AndroidResources} object. If no filtering was done, this object willbe returned.
 */
public AndroidResources filterLocalResources(ResourceFilter resourceFilter){
  return maybeFilter(resourceFilter,false).orElse(this);
}

Fixed version (ground truth):
/** 
 * Filters this object, assuming it contains the resources of the current target. <p>If this object contains the resources from a dependency of this target, use   {@link #maybeFilter(RuleErrorConsumer,ResourceFilter,boolean)} instead.
 * @return a filtered {@link AndroidResources} object. If no filtering was done, this object willbe returned.
 */
public AndroidResources filterLocalResources(RuleErrorConsumer errorConsumer,ResourceFilter resourceFilter) throws RuleErrorException {
  return maybeFilter(errorConsumer,resourceFilter,false).orElse(this);
}
Program: 110579
Project: 110579
Buggy source:
/** 
 * Returns a copy of this container with filtered resources, or the original if no resources should be filtered. The original container is unchanged.
 */
public ResourceContainer filter(ResourceFilter filter,boolean isDependency){
  Optional<AndroidResources> filteredResources=getResources().maybeFilter(filter,isDependency);
  if (!filteredResources.isPresent()) {
    return this;
  }
  return toBuilder().setResources(filteredResources.get()).build();
}

Fixed version (ground truth):
/** 
 * Returns a copy of this container with filtered resources, or the original if no resources should be filtered. The original container is unchanged.
 */
public ResourceContainer filter(RuleErrorConsumer errorConsumer,ResourceFilter filter,boolean isDependency) throws RuleErrorException {
  Optional<AndroidResources> filteredResources=getResources().maybeFilter(errorConsumer,filter,isDependency);
  if (!filteredResources.isPresent()) {
    return this;
  }
  return toBuilder().setResources(filteredResources.get()).build();
}
Program: 110580
Project: 110580
Buggy source:
/** 
 * Returns a copy of this instance with filtered resources. The original object is unchanged. 
 */
public ResourceDependencies filter(ResourceFilter resourceFilter){
  Optional<NestedSet<Artifact>> filteredResources=resourceFilter.maybeFilterDependencies(transitiveResources);
  if (!filteredResources.isPresent()) {
    return this;
  }
  return withResources(resourceFilter.filterDependencyContainers(transitiveResourceContainers),resourceFilter.filterDependencyContainers(directResourceContainers),filteredResources.get());
}

Fixed version (ground truth):
/** 
 * Returns a copy of this instance with filtered resources. The original object is unchanged. 
 */
public ResourceDependencies filter(RuleErrorConsumer errorConsumer,ResourceFilter resourceFilter) throws RuleErrorException {
  Optional<NestedSet<Artifact>> filteredResources=resourceFilter.maybeFilterDependencies(transitiveResources);
  if (!filteredResources.isPresent()) {
    return this;
  }
  return withResources(resourceFilter.filterDependencyContainers(errorConsumer,transitiveResourceContainers),resourceFilter.filterDependencyContainers(errorConsumer,directResourceContainers),filteredResources.get());
}
Program: 110581
Project: 110581
Buggy source:
public NestedSet<ResourceContainer> filterDependencyContainers(NestedSet<ResourceContainer> resourceContainers){
  if (isEmpty) {
    return resourceContainers;
  }
  NestedSetBuilder<ResourceContainer> builder=new NestedSetBuilder<>(resourceContainers.getOrder());
  for (  ResourceContainer container : resourceContainers) {
    builder.add(container.filter(this,true));
  }
  return builder.build();
}

Fixed version (ground truth):
public NestedSet<ResourceContainer> filterDependencyContainers(RuleErrorConsumer errorConsumer,NestedSet<ResourceContainer> resourceContainers) throws RuleErrorException {
  if (isEmpty) {
    return resourceContainers;
  }
  NestedSetBuilder<ResourceContainer> builder=new NestedSetBuilder<>(resourceContainers.getOrder());
  for (  ResourceContainer container : resourceContainers) {
    builder.add(container.filter(errorConsumer,this,true));
  }
  return builder.build();
}
Program: 110582
Project: 110582
Buggy source:
private void assertFilter(ImmutableList<Artifact> unfilteredResources,ImmutableList<Artifact> filteredResources,boolean isDependency) throws Exception {
  ImmutableList<PathFragment> unfilteredResourcesRoots=getResourceRoots(unfilteredResources);
  AndroidResources unfiltered=new AndroidResources(unfilteredResources,unfilteredResourcesRoots);
  ImmutableList.Builder<Artifact> filteredDepsBuilder=ImmutableList.builder();
  ResourceFilter fakeFilter=ResourceFilter.of(ImmutableSet.copyOf(filteredResources),filteredDepsBuilder::add);
  Optional<AndroidResources> filtered=unfiltered.maybeFilter(fakeFilter,isDependency);
  if (filteredResources.equals(unfilteredResources)) {
    assertThat(filtered.isPresent()).isFalse();
  }
 else {
    assertThat(filtered.get().getResources()).containsExactlyElementsIn(filteredResources).inOrder();
    assertThat(filtered.get().getResourceRoots()).containsExactlyElementsIn(getResourceRoots(filteredResources)).inOrder();
  }
  if (!isDependency) {
    assertThat(filteredDepsBuilder.build()).isEmpty();
  }
 else {
    assertThat(unfilteredResources).containsExactlyElementsIn(Iterables.concat(filteredDepsBuilder.build(),filteredResources));
  }
}

Fixed version (ground truth):
private void assertFilter(ImmutableList<Artifact> unfilteredResources,ImmutableList<Artifact> filteredResources,boolean isDependency) throws Exception {
  ImmutableList<PathFragment> unfilteredResourcesRoots=getResourceRoots(unfilteredResources);
  AndroidResources unfiltered=new AndroidResources(unfilteredResources,unfilteredResourcesRoots);
  ImmutableList.Builder<Artifact> filteredDepsBuilder=ImmutableList.builder();
  ResourceFilter fakeFilter=ResourceFilter.of(ImmutableSet.copyOf(filteredResources),filteredDepsBuilder::add);
  Optional<AndroidResources> filtered=unfiltered.maybeFilter(errorConsumer,fakeFilter,isDependency);
  if (filteredResources.equals(unfilteredResources)) {
    assertThat(filtered.isPresent()).isFalse();
  }
 else {
    assertThat(filtered.get().getResources()).containsExactlyElementsIn(filteredResources).inOrder();
    assertThat(filtered.get().getResourceRoots()).containsExactlyElementsIn(getResourceRoots(filteredResources)).inOrder();
  }
  if (!isDependency) {
    assertThat(filteredDepsBuilder.build()).isEmpty();
  }
 else {
    assertThat(unfilteredResources).containsExactlyElementsIn(Iterables.concat(filteredDepsBuilder.build(),filteredResources));
  }
}
Program: 110584
Project: 110584
Buggy source:
private ImmutableList<Artifact> doFilter(ResourceFilterFactory resourceFilterFactory,ImmutableList<Artifact> artifacts) throws RuleErrorException {
  AndroidResources localResources=AndroidResources.forResources(errorConsumer,artifacts,"String_Node_Str");
  ResourceDependencies resourceDeps=ResourceDependencies.empty();
  ResourceFilter filter=resourceFilterFactory.getResourceFilter(errorConsumer,resourceDeps,localResources);
  assertThat(resourceDeps.filter(filter)).isSameAs(resourceDeps);
  return localResources.filterLocalResources(filter).getResources();
}

Fixed version (ground truth):
private ImmutableList<Artifact> doFilter(ResourceFilterFactory resourceFilterFactory,ImmutableList<Artifact> artifacts) throws RuleErrorException {
  AndroidResources localResources=AndroidResources.forResources(errorConsumer,artifacts,"String_Node_Str");
  ResourceDependencies resourceDeps=ResourceDependencies.empty();
  ResourceFilter filter=resourceFilterFactory.getResourceFilter(errorConsumer,resourceDeps,localResources);
  assertThat(resourceDeps.filter(errorConsumer,filter)).isSameAs(resourceDeps);
  return localResources.filterLocalResources(errorConsumer,filter).getResources();
}
Program: 110586
Project: 110586
Buggy source:
private static J2ObjcSource protoJ2ObjcSource(RuleContext ruleContext,ImmutableList<Artifact> protoSources){
  PathFragment objcFileRootExecPath=ruleContext.getConfiguration().getGenfilesDirectory(ruleContext.getRule().getRepository()).getExecPath();
  Iterable<PathFragment> headerSearchPaths=J2ObjcLibrary.j2objcSourceHeaderSearchPaths(ruleContext,objcFileRootExecPath,protoSources);
  return new J2ObjcSource(ruleContext.getTarget().getLabel(),ProtoCommon.getGeneratedOutputs(ruleContext,protoSources,"String_Node_Str"),ProtoCommon.getGeneratedOutputs(ruleContext,protoSources,"String_Node_Str"),objcFileRootExecPath,SourceType.PROTO,headerSearchPaths);
}

Fixed version (ground truth):
private static J2ObjcSource protoJ2ObjcSource(RuleContext ruleContext,ImmutableList<Artifact> protoSources){
  PathFragment objcFileRootExecPath=getProtoOutputRoot(ruleContext);
  Iterable<PathFragment> headerSearchPaths=J2ObjcLibrary.j2objcSourceHeaderSearchPaths(ruleContext,objcFileRootExecPath,protoSources);
  return new J2ObjcSource(ruleContext.getTarget().getLabel(),ProtoCommon.getGeneratedOutputs(ruleContext,protoSources,"String_Node_Str"),ProtoCommon.getGeneratedOutputs(ruleContext,protoSources,"String_Node_Str"),objcFileRootExecPath,SourceType.PROTO,headerSearchPaths);
}
Program: 110587
Project: 110587
Buggy source:
@Test public void outputDirectoryForProtoCompileAction_externalRepos() throws Exception {
  scratch.file("String_Node_Str","String_Node_Str");
  scratch.file("String_Node_Str");
  scratch.file("String_Node_Str","String_Node_Str","String_Node_Str");
  String existingWorkspace=new String(FileSystemUtils.readContentAsLatin1(rootDirectory.getRelative("String_Node_Str")));
  scratch.overwriteFile("String_Node_Str","String_Node_Str",existingWorkspace);
  invalidatePackages();
  Artifact hFile=getFirstArtifactEndingWith(getFilesToBuild(getConfiguredTarget("String_Node_Str")),"String_Node_Str");
  SpawnAction protoCompileAction=getGeneratingSpawnAction(hFile);
  assertThat(protoCompileAction.getArguments()).contains(String.format("String_Node_Str",getTargetConfiguration().getGenfilesFragment().toString()));
}

Fixed version (ground truth):
@Test public void outputDirectoryForProtoCompileAction_externalRepos() throws Exception {
  scratch.file("String_Node_Str","String_Node_Str");
  scratch.file("String_Node_Str");
  scratch.file("String_Node_Str","String_Node_Str","String_Node_Str");
  String existingWorkspace=new String(FileSystemUtils.readContentAsLatin1(rootDirectory.getRelative("String_Node_Str")));
  scratch.overwriteFile("String_Node_Str","String_Node_Str",existingWorkspace);
  invalidatePackages();
  ConfiguredTarget target=getConfiguredTarget("String_Node_Str");
  Artifact hFile=getFirstArtifactEndingWith(getFilesToBuild(target),"String_Node_Str");
  SpawnAction protoCompileAction=getGeneratingSpawnAction(hFile);
  assertThat(protoCompileAction.getArguments()).contains(String.format("String_Node_Str",getTargetConfiguration().getGenfilesFragment().toString()));
  Artifact headerFile=getGenfilesArtifactWithNoOwner("String_Node_Str");
  CcCompilationInfo ccCompilationInfo=target.get(CcCompilationInfo.PROVIDER);
  assertThat(ccCompilationInfo.getDeclaredIncludeSrcs()).containsExactly(headerFile);
}
Program: 110588
Project: 110588
Buggy source:
private int fromString(String string,Location loc,int base) throws EvalException {
  String prefix=getIntegerPrefix(string);
  String digits;
  if (prefix == null) {
    digits=string;
    if (base == 0) {
      if (string.length() > 1 && string.startsWith("String_Node_Str")) {
        throw new EvalException(loc,Printer.format("String_Node_Str",string));
      }
      base=10;
    }
  }
 else {
    digits=string.substring(prefix.length());
    int expectedBase=intPrefixes.get(prefix);
    if (base == 0) {
      base=expectedBase;
    }
 else     if (base != expectedBase) {
      throw new EvalException(loc,Printer.format("String_Node_Str",base,string));
    }
  }
  if (base < 2 || base > 36) {
    throw new EvalException(loc,"String_Node_Str");
  }
  try {
    return Integer.parseInt(digits,base);
  }
 catch (  NumberFormatException e) {
    throw new EvalException(loc,Printer.format("String_Node_Str",base,string));
  }
}

Fixed version (ground truth):
private int fromString(String string,Location loc,int base) throws EvalException {
  String stringForErrors=string;
  boolean isNegative=false;
  if (string.isEmpty()) {
    throw new EvalException(loc,Printer.format("String_Node_Str"));
  }
  char c=string.charAt(0);
  if (c == '+') {
    string=string.substring(1);
  }
 else   if (c == '-') {
    string=string.substring(1);
    isNegative=true;
  }
  String prefix=getIntegerPrefix(string);
  String digits;
  if (prefix == null) {
    digits=string;
    if (base == 0) {
      if (string.length() > 1 && string.startsWith("String_Node_Str")) {
        throw new EvalException(loc,Printer.format("String_Node_Str",stringForErrors));
      }
      base=10;
    }
  }
 else {
    digits=string.substring(prefix.length());
    int expectedBase=intPrefixes.get(prefix);
    if (base == 0) {
      base=expectedBase;
    }
 else     if (base != expectedBase) {
      throw new EvalException(loc,Printer.format("String_Node_Str",base,stringForErrors));
    }
  }
  if (base < 2 || base > 36) {
    throw new EvalException(loc,"String_Node_Str");
  }
  try {
    String parseable=isNegative ? "String_Node_Str" + digits : digits;
    return Integer.parseInt(parseable,base);
  }
 catch (  NumberFormatException|ArithmeticException e) {
    throw new EvalException(loc,Printer.format("String_Node_Str",base,stringForErrors));
  }
}
Program: 110589
Project: 110589
Buggy source:
@Override public String getDetailMessage(String messagePrefix,String message,boolean catastrophe,boolean forciblyRunRemotely){
  TerminationStatus status=new TerminationStatus(exitCode(),status() == Status.TIMEOUT);
  String reason="String_Node_Str" + status.toShortString() + "String_Node_Str";
  String explanation=status.exited() ? "String_Node_Str" : "String_Node_Str" + message;
  if (!status().isConsideredUserError()) {
    String errorDetail=status().name().toLowerCase(Locale.US).replace('_',' ');
    explanation+="String_Node_Str" + errorDetail;
  }
  if (status() == Status.TIMEOUT) {
    Preconditions.checkState(getWallTime().isPresent(),"String_Node_Str");
    explanation+=String.format("String_Node_Str",getWallTime().get().toMillis() / 1000.0);
  }
 else   if (status() == Status.OUT_OF_MEMORY) {
    explanation+="String_Node_Str";
  }
  if (status() != Status.TIMEOUT && forciblyRunRemotely) {
    explanation+="String_Node_Str" + "String_Node_Str";
  }
  return messagePrefix + "String_Node_Str" + reason+ explanation;
}

Fixed version (ground truth):
@Override public String getDetailMessage(String messagePrefix,String message,boolean catastrophe,boolean forciblyRunRemotely){
  TerminationStatus status=new TerminationStatus(exitCode(),status() == Status.TIMEOUT);
  String reason="String_Node_Str" + status.toShortString() + "String_Node_Str";
  String explanation=status.exited() ? "String_Node_Str" : "String_Node_Str" + message;
  if (!status().isConsideredUserError()) {
    String errorDetail=status().name().toLowerCase(Locale.US).replace('_',' ');
    explanation+="String_Node_Str" + errorDetail;
  }
  if (status() == Status.TIMEOUT) {
    if (getWallTime().isPresent()) {
      explanation+=String.format("String_Node_Str",getWallTime().get().toMillis() / 1000.0);
    }
 else {
      explanation+="String_Node_Str";
    }
  }
 else   if (status() == Status.OUT_OF_MEMORY) {
    explanation+="String_Node_Str";
  }
  if (status() != Status.TIMEOUT && forciblyRunRemotely) {
    explanation+="String_Node_Str" + "String_Node_Str";
  }
  return messagePrefix + "String_Node_Str" + reason+ explanation;
}
Program: 110590
Project: 110590
Buggy source:
@Override public MethodVisitor visitMethod(int access,String name,String desc,String signature,String[] exceptions){
  members.add(MemberInfo.create(internalName,name,desc));
  return null;
}

Fixed version (ground truth):
@Override public MethodVisitor visitMethod(int access,String name,String desc,String signature,String[] exceptions){
  members.add(MemberInfo.create(name,desc));
  return null;
}
Program: 110591
Project: 110591
Buggy source:
@Override public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  members.add(MemberInfo.create(internalName,name,desc));
  return null;
}

Fixed version (ground truth):
@Override public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  members.add(MemberInfo.create(name,desc));
  return null;
}
Program: 110592
Project: 110592
Buggy source:
public static MemberInfo create(String owner,String memberName,String descriptor){
  checkArgument(!Strings.isNullOrEmpty(owner),"String_Node_Str",owner);
  checkArgument(!Strings.isNullOrEmpty(memberName),"String_Node_Str",memberName);
  checkArgument(!Strings.isNullOrEmpty(descriptor),"String_Node_Str",descriptor);
  return new AutoValue_ClassInfo_MemberInfo(owner,memberName,descriptor);
}

Fixed version (ground truth):
public static MemberInfo create(String memberName,String descriptor){
  checkArgument(!Strings.isNullOrEmpty(memberName),"String_Node_Str",memberName);
  checkArgument(!Strings.isNullOrEmpty(descriptor),"String_Node_Str",descriptor);
  return new AutoValue_ClassInfo_MemberInfo(memberName,descriptor);
}
Program: 110593
Project: 110593
Buggy source:
private AbstractClassEntryState checkInternalName(String internalName){
  AbstractClassEntryState state=classCache.getClassState(internalName);
  if (state.isMissingState()) {
    resultCollector.addMissingOrIncompleteClass(internalName,state);
  }
 else   if (state.isIncompleteState()) {
    String missingAncestor=state.asIncompleteState().getMissingAncestor();
    AbstractClassEntryState ancestorState=classCache.getClassState(missingAncestor);
    checkState(ancestorState.isMissingState(),"String_Node_Str",ancestorState);
    resultCollector.addMissingOrIncompleteClass(missingAncestor,ancestorState);
    resultCollector.addMissingOrIncompleteClass(internalName,state);
  }
  return state;
}

Fixed version (ground truth):
private AbstractClassEntryState checkInternalName(String internalName){
  checkArgument(internalName.length() > 0 && Character.isJavaIdentifierStart(internalName.charAt(0)),"String_Node_Str",internalName);
  AbstractClassEntryState state=classCache.getClassState(internalName);
  if (state.isMissingState()) {
    resultCollector.addMissingOrIncompleteClass(internalName,state);
  }
 else   if (state.isIncompleteState()) {
    String missingAncestor=state.asIncompleteState().getMissingAncestor();
    AbstractClassEntryState ancestorState=classCache.getClassState(missingAncestor);
    checkState(ancestorState.isMissingState(),"String_Node_Str",ancestorState);
    resultCollector.addMissingOrIncompleteClass(missingAncestor,ancestorState);
    resultCollector.addMissingOrIncompleteClass(internalName,state);
  }
  return state;
}
Program: 110594
Project: 110594
Buggy source:
@Override public void visitTypeInsn(int opcode,String type){
  checkInternalName(type);
  super.visitTypeInsn(opcode,type);
}

Fixed version (ground truth):
@Override public void visitTypeInsn(int opcode,String type){
  checkInternalNameOrArrayDescriptor(type);
  super.visitTypeInsn(opcode,type);
}
Program: 110595
Project: 110595
Buggy source:
private void checkMember(String owner,String name,String desc){
  checkDescriptor(desc);
  AbstractClassEntryState state=checkInternalName(owner);
  Optional<ClassInfo> classInfo=state.classInfo();
  if (!classInfo.isPresent()) {
    checkState(state.isMissingState(),"String_Node_Str",state);
    return;
  }
  MemberInfo member=MemberInfo.create(owner,name,desc);
  if (!classInfo.get().containsMember(member)) {
    resultCollector.addMissingMember(member);
  }
}

Fixed version (ground truth):
private void checkMember(String owner,String name,String desc){
  try {
    if (checkInternalNameOrArrayDescriptor(owner)) {
      return;
    }
    checkDescriptor(desc);
    AbstractClassEntryState state=checkInternalName(owner);
    Optional<ClassInfo> classInfo=state.classInfo();
    if (!classInfo.isPresent()) {
      checkState(state.isMissingState(),"String_Node_Str",state);
      return;
    }
    MemberInfo member=MemberInfo.create(name,desc);
    if (!classInfo.get().containsMember(member)) {
      resultCollector.addMissingMember(owner,member);
    }
  }
 catch (  RuntimeException e) {
    System.err.printf("String_Node_Str",owner,name,desc);
    throw e;
  }
}
Program: 110597
Project: 110597
Buggy source:
/** 
 * Checks for dependency problems in the given input jars agains the classpath.
 * @return {@literal true} for no problems, {@literal false} otherwise.
 */
public boolean check() throws IOException {
  for (  Path path : inputJars) {
    try (ZipFile jarFile=new ZipFile(path.toFile())){
      jarFile.stream().forEach(entry -> {
        String name=entry.getName();
        if (!name.endsWith("String_Node_Str")) {
          return;
        }
        try (InputStream inputStream=jarFile.getInputStream(entry)){
          ClassReader reader=new ClassReader(inputStream);
          DepsCheckerClassVisitor checker=new DepsCheckerClassVisitor(classCache,resultCollector);
          reader.accept(checker,ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
        }
 catch (        IOException e) {
          throw new IOError(e);
        }
      }
);
    }
   }
  return resultCollector.isEmpty();
}

Fixed version (ground truth):
/** 
 * Checks for dependency problems in the given input jars agains the classpath.
 * @return {@literal true} for no problems, {@literal false} otherwise.
 */
public boolean check() throws IOException {
  for (  Path path : inputJars) {
    try (ZipFile jarFile=new ZipFile(path.toFile())){
      jarFile.stream().forEach(entry -> {
        String name=entry.getName();
        if (!name.endsWith("String_Node_Str")) {
          return;
        }
        try (InputStream inputStream=jarFile.getInputStream(entry)){
          ClassReader reader=new ClassReader(inputStream);
          DepsCheckerClassVisitor checker=new DepsCheckerClassVisitor(classCache,resultCollector);
          reader.accept(checker,ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
        }
 catch (        IOException e) {
          throw new IOError(e);
        }
catch (        RuntimeException e) {
          System.err.printf("String_Node_Str" + "String_Node_Str",name,path);
          throw e;
        }
      }
);
    }
   }
  return resultCollector.isEmpty();
}
Program: 110598
Project: 110598
Buggy source:
public ImmutableList<MemberInfo> getSortedMissingMembers(){
  return ImmutableList.sortedCopyOf(missingMembers);
}

Fixed version (ground truth):
public ImmutableList<MissingMember> getSortedMissingMembers(){
  return ImmutableList.sortedCopyOf(missingMembers);
}
Program: 110599
Project: 110599
Buggy source:
public void addMissingMember(MemberInfo member){
  missingMembers.add(member);
}

Fixed version (ground truth):
public void addMissingMember(String owner,MemberInfo member){
  missingMembers.add(MissingMember.create(owner,member));
}
Program: 110600
Project: 110600
Buggy source:
@Test public void testMemberInfo(){
  MemberInfo memberInfo=MemberInfo.create(JAVA_LANG_OBJECT,"String_Node_Str","String_Node_Str");
  assertThat(memberInfo.memberName()).isEqualTo("String_Node_Str");
  assertThat(memberInfo.descriptor()).isEqualTo("String_Node_Str");
  assertThat(memberInfo).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertThat(hashCodeMethod).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertThat(sizeMethod).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMemberInfo(){
  MemberInfo memberInfo=MemberInfo.create("String_Node_Str","String_Node_Str");
  assertThat(memberInfo.memberName()).isEqualTo("String_Node_Str");
  assertThat(memberInfo.descriptor()).isEqualTo("String_Node_Str");
  assertThat(memberInfo).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str"));
  assertThat(hashCodeMethod).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str"));
  assertThat(sizeMethod).isEqualTo(MemberInfo.create("String_Node_Str","String_Node_Str"));
}
Program: 110601
Project: 110601
Buggy source:
@Test public void testContainsMember(){
  ClassInfo parent=objectClass;
  ClassInfo child=listClass;
  assertThat(child.superClasses()).contains(parent);
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isFalse();
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isFalse();
  assertThat(child.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(child.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isTrue();
}

Fixed version (ground truth):
@Test public void testContainsMember(){
  ClassInfo parent=objectClass;
  ClassInfo child=listClass;
  assertThat(child.superClasses()).contains(parent);
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isFalse();
  assertThat(parent.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isFalse();
  assertThat(child.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(child.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isTrue();
}
Program: 110602
Project: 110602
Buggy source:
@Test public void testClassInfoCorrectlySet(){
  assertThat(objectClass.internalName()).isEqualTo("String_Node_Str");
  assertThat(objectClass.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str")).inOrder();
  assertThat(objectClass.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(listClass.internalName()).isEqualTo("String_Node_Str");
  assertThat(listClass.declaredMembers()).containsExactly(sizeMethod);
  assertThat(listClass.containsMember(hashCodeMethod)).isTrue();
}

Fixed version (ground truth):
@Test public void testClassInfoCorrectlySet(){
  assertThat(objectClass.internalName()).isEqualTo("String_Node_Str");
  assertThat(objectClass.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str")).inOrder();
  assertThat(objectClass.containsMember(MemberInfo.create("String_Node_Str","String_Node_Str"))).isTrue();
  assertThat(listClass.internalName()).isEqualTo("String_Node_Str");
  assertThat(listClass.declaredMembers()).containsExactly(sizeMethod);
  assertThat(listClass.containsMember(hashCodeMethod)).isTrue();
}
Program: 110603
Project: 110603
Buggy source:
private ResultCollector getResultCollector(Path... classpath) throws IOException {
  ImmutableList<String> clientClasses=ImmutableList.of(PACKAGE_NAME + "String_Node_Str",PACKAGE_NAME + "String_Node_Str");
  ResultCollector resultCollector=new ResultCollector();
  try (ClassCache cache=new ClassCache(ImmutableList.copyOf(classpath));ZipFile zipFile=new ZipFile(clientJar.toFile())){
    AbstractClassEntryState state=cache.getClassState("String_Node_Str");
    System.out.println(state);
    for (    String clientClass : clientClasses) {
      ZipEntry entry=zipFile.getEntry(clientClass + "String_Node_Str");
      try (InputStream classStream=zipFile.getInputStream(entry)){
        ClassReader reader=new ClassReader(classStream);
        DepsCheckerClassVisitor checker=new DepsCheckerClassVisitor(cache,resultCollector);
        reader.accept(checker,ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
      }
     }
  }
   return resultCollector;
}

Fixed version (ground truth):
private ResultCollector getResultCollector(Path... classpath) throws IOException {
  ImmutableList<String> clientClasses=ImmutableList.of(PACKAGE_NAME + "String_Node_Str",PACKAGE_NAME + "String_Node_Str");
  ResultCollector resultCollector=new ResultCollector();
  try (ClassCache cache=new ClassCache(ImmutableList.copyOf(classpath));ZipFile zipFile=new ZipFile(clientJar.toFile())){
    assertThat(cache.getClassState("String_Node_Str").isExistingState()).isTrue();
    AbstractClassEntryState state=cache.getClassState("String_Node_Str");
    assertThat(state.isExistingState()).isTrue();
    for (    String clientClass : clientClasses) {
      ZipEntry entry=zipFile.getEntry(clientClass + "String_Node_Str");
      try (InputStream classStream=zipFile.getInputStream(entry)){
        ClassReader reader=new ClassReader(classStream);
        DepsCheckerClassVisitor checker=new DepsCheckerClassVisitor(cache,resultCollector);
        reader.accept(checker,ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
      }
     }
  }
   return resultCollector;
}
Program: 110604
Project: 110604
Buggy source:
@Test public void testMissingMembersInClient() throws IOException {
  ResultCollector collector=getResultCollector(bootclasspath,libraryAnnotationsJar,libraryInterfaceJar,libraryWoMembersJar,libraryExceptionJar,clientJar);
  assertThat(collector.getSortedMissingClassInternalNames()).isEmpty();
  assertThat(collector.getSortedMissingMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"),MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"),MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"),MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str")).inOrder();
}

Fixed version (ground truth):
@Test public void testMissingMembersInClient() throws IOException {
  ResultCollector collector=getResultCollector(bootclasspath,libraryAnnotationsJar,libraryInterfaceJar,libraryWoMembersJar,libraryExceptionJar,clientJar);
  assertThat(collector.getSortedMissingClassInternalNames()).isEmpty();
  assertThat(collector.getSortedMissingMembers()).containsExactly(MissingMember.create("String_Node_Str","String_Node_Str","String_Node_Str"),MissingMember.create("String_Node_Str","String_Node_Str","String_Node_Str"),MissingMember.create("String_Node_Str","String_Node_Str","String_Node_Str"),MissingMember.create("String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str")).inOrder();
}
Program: 110605
Project: 110605
Buggy source:
@Test public void testIncompleteState(){
  assertThrows(IllegalArgumentException.class,() -> IncompleteState.create(LIST_CLASS_INFO,ImmutableList.of()));
  IncompleteState state=IncompleteState.create(LIST_CLASS_INFO,ImmutableList.of("String_Node_Str"));
  assertThat(state.isExistingState()).isFalse();
  assertThat(state.isIncompleteState()).isTrue();
  assertThat(state.isMissingState()).isFalse();
  assertThat(state.asIncompleteState()).isSameAs(state);
  assertThrows(IllegalStateException.class,() -> state.asExistingState());
  assertThrows(IllegalStateException.class,() -> state.asMissingState());
  ClassInfo classInfo=state.classInfo().get();
  assertThat(classInfo.internalName()).isEqualTo("String_Node_Str");
  assertThat(classInfo.declaredMembers()).hasSize(1);
  assertThat(classInfo.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"));
  ImmutableList<String> failurePath=state.getResolutionFailurePath();
  assertThat(failurePath).hasSize(1);
  assertThat(failurePath).containsExactly("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testIncompleteState(){
  assertThrows(IllegalArgumentException.class,() -> IncompleteState.create(LIST_CLASS_INFO,ImmutableList.of()));
  IncompleteState state=IncompleteState.create(LIST_CLASS_INFO,ImmutableList.of("String_Node_Str"));
  assertThat(state.isExistingState()).isFalse();
  assertThat(state.isIncompleteState()).isTrue();
  assertThat(state.isMissingState()).isFalse();
  assertThat(state.asIncompleteState()).isSameAs(state);
  assertThrows(IllegalStateException.class,() -> state.asExistingState());
  assertThrows(IllegalStateException.class,() -> state.asMissingState());
  ClassInfo classInfo=state.classInfo().get();
  assertThat(classInfo.internalName()).isEqualTo("String_Node_Str");
  assertThat(classInfo.declaredMembers()).hasSize(1);
  assertThat(classInfo.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str"));
  ImmutableList<String> failurePath=state.getResolutionFailurePath();
  assertThat(failurePath).hasSize(1);
  assertThat(failurePath).containsExactly("String_Node_Str");
}
Program: 110606
Project: 110606
Buggy source:
@Test public void testExistingState(){
  ExistingState state=ExistingState.create(LIST_CLASS_INFO);
  assertThat(state.isExistingState()).isTrue();
  assertThat(state.isIncompleteState()).isFalse();
  assertThat(state.isMissingState()).isFalse();
  assertThat(state.asExistingState()).isSameAs(state);
  assertThrows(IllegalStateException.class,() -> state.asIncompleteState());
  assertThrows(IllegalStateException.class,() -> state.asMissingState());
  ClassInfo classInfo=state.classInfo().get();
  assertThat(classInfo.internalName()).isEqualTo("String_Node_Str");
  assertThat(classInfo.declaredMembers()).hasSize(1);
  assertThat(classInfo.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testExistingState(){
  ExistingState state=ExistingState.create(LIST_CLASS_INFO);
  assertThat(state.isExistingState()).isTrue();
  assertThat(state.isIncompleteState()).isFalse();
  assertThat(state.isMissingState()).isFalse();
  assertThat(state.asExistingState()).isSameAs(state);
  assertThrows(IllegalStateException.class,() -> state.asIncompleteState());
  assertThrows(IllegalStateException.class,() -> state.asMissingState());
  ClassInfo classInfo=state.classInfo().get();
  assertThat(classInfo.internalName()).isEqualTo("String_Node_Str");
  assertThat(classInfo.declaredMembers()).hasSize(1);
  assertThat(classInfo.declaredMembers()).containsExactly(MemberInfo.create("String_Node_Str","String_Node_Str"));
}
Program: 110607
Project: 110607
Buggy source:
private static void expandToPathIgnoringRepository(Artifact artifact,Consumer<String> args){
  args.accept(getPathIgnoringRepository(artifact));
}

Fixed version (ground truth):
private static void expandToPathIgnoringRepository(Artifact artifact,Consumer<String> args){
  args.accept(ProtoCommon.getPathIgnoringRepository(artifact).toString());
}
Program: 110608
Project: 110608
Buggy source:
private static void expandTransitiveImportArg(Artifact artifact,Consumer<String> args){
  args.accept("String_Node_Str" + getPathIgnoringRepository(artifact) + "String_Node_Str"+ artifact.getExecPathString());
}

Fixed version (ground truth):
private static void expandTransitiveImportArg(Artifact artifact,Consumer<String> args){
  args.accept("String_Node_Str" + ProtoCommon.getPathIgnoringRepository(artifact).toString() + "String_Node_Str"+ artifact.getExecPathString());
}
Program: 110609
Project: 110609
Buggy source:
static Action buildAction(Path execRoot,Collection<? extends ActionInput> outputs,Digest command,Digest inputRoot,@Nullable PlatformInfo executionPlatform,Duration timeout,boolean cacheable){
  Action.Builder action=Action.newBuilder();
  action.setCommandDigest(command);
  action.setInputRootDigest(inputRoot);
  ArrayList<String> outputPaths=new ArrayList<>();
  ArrayList<String> outputDirectoryPaths=new ArrayList<>();
  for (  ActionInput output : outputs) {
    String pathString=output.getExecPathString();
    if (execRoot.getRelative(pathString).isDirectory()) {
      outputDirectoryPaths.add(pathString);
    }
 else {
      outputPaths.add(pathString);
    }
  }
  Collections.sort(outputPaths);
  Collections.sort(outputDirectoryPaths);
  action.addAllOutputFiles(outputPaths);
  if (executionPlatform != null) {
    Platform platform=parsePlatform(executionPlatform.label(),executionPlatform.remoteExecutionProperties());
    action.setPlatform(platform);
  }
  if (!timeout.isZero()) {
    action.setTimeout(com.google.protobuf.Duration.newBuilder().setSeconds(timeout.getSeconds()));
  }
  if (!cacheable) {
    action.setDoNotCache(true);
  }
  return action.build();
}

Fixed version (ground truth):
static Action buildAction(Path execRoot,Collection<? extends ActionInput> outputs,Digest command,Digest inputRoot,@Nullable PlatformInfo executionPlatform,Duration timeout,boolean cacheable){
  Action.Builder action=Action.newBuilder();
  action.setCommandDigest(command);
  action.setInputRootDigest(inputRoot);
  ArrayList<String> outputPaths=new ArrayList<>();
  ArrayList<String> outputDirectoryPaths=new ArrayList<>();
  for (  ActionInput output : outputs) {
    String pathString=output.getExecPathString();
    if (execRoot.getRelative(pathString).isDirectory()) {
      outputDirectoryPaths.add(pathString);
    }
 else {
      outputPaths.add(pathString);
    }
  }
  Collections.sort(outputPaths);
  Collections.sort(outputDirectoryPaths);
  action.addAllOutputFiles(outputPaths);
  action.addAllOutputDirectories(outputDirectoryPaths);
  if (executionPlatform != null) {
    Platform platform=parsePlatform(executionPlatform.label(),executionPlatform.remoteExecutionProperties());
    action.setPlatform(platform);
  }
  if (!timeout.isZero()) {
    action.setTimeout(com.google.protobuf.Duration.newBuilder().setSeconds(timeout.getSeconds()));
  }
  if (!cacheable) {
    action.setDoNotCache(true);
  }
  return action.build();
}
Program: 110610
Project: 110610
Buggy source:
/** 
 * Returns a new   {@link Runfiles} instance.<p>The returned object is either: <ul> <li>manifest-based, meaning it looks up runfile paths from a manifest file, or <li>directory-based, meaning it looks up runfile paths under a given directory path </ul> <p>If  {@code env} contains "RUNFILES_MANIFEST_ONLY" with value "1", this method returns amanifest-based implementation. The manifest's path is defined by the "RUNFILES_MANIFEST_FILE" key's value in  {@code env}. <p>Otherwise this method returns a directory-based implementation. The directory's path is defined by the "RUNFILES_DIR" or "TEST_SRCDIR" key's value in   {@code env}, in this priority order. <p>Note about performance: the manifest-based implementation eagerly reads and caches the whole manifest file upon instantiation.
 * @throws IOException if RUNFILES_MANIFEST_ONLY=1 is in {@code env} but there's no"RUNFILES_MANIFEST_FILE", or if neither "RUNFILES_DIR" nor "TEST_SRCDIR" is in  {@code env}, or if some IO error occurs
 */
public static Runfiles create(Map<String,String> env) throws IOException {
  if (isManifestOnly(env)) {
    return new ManifestBased(getManifestPath(env));
  }
 else {
    return new DirectoryBased(getRunfilesDir(env));
  }
}

Fixed version (ground truth):
/** 
 * Returns a new   {@link Runfiles} instance.<p>The returned object is either: <ul> <li>manifest-based, meaning it looks up runfile paths from a manifest file, or <li>directory-based, meaning it looks up runfile paths under a given directory path </ul> <p>If  {@code env} contains "RUNFILES_MANIFEST_ONLY" with value "1", this method returns amanifest-based implementation. The manifest's path is defined by the "RUNFILES_MANIFEST_FILE" key's value in  {@code env}. <p>Otherwise this method returns a directory-based implementation. The directory's path is defined by the value in   {@code env} under the "RUNFILES_DIR" key, or if absent, then under the"JAVA_RUNFILES" key. <p>Note about performance: the manifest-based implementation eagerly reads and caches the whole manifest file upon instantiation.
 * @throws IOException if RUNFILES_MANIFEST_ONLY=1 is in {@code env} but there's no"RUNFILES_MANIFEST_FILE", "RUNFILES_DIR", or "JAVA_RUNFILES" key in  {@code env} or theirvalues are empty, or some IO error occurs
 */
public static Runfiles create(Map<String,String> env) throws IOException {
  if (isManifestOnly(env)) {
    return new ManifestBased(getManifestPath(env));
  }
 else {
    return new DirectoryBased(getRunfilesDir(env));
  }
}
Program: 110611
Project: 110611
Buggy source:
/** 
 * Returns the runtime path of a runfile (a Bazel-built binary's/test's data-dependency). <p>The returned path may not be valid. The caller should check the path's validity and that the path exists. <p>The function may return null. In that case the caller can be sure that the rule does not know about this data-dependency.
 * @param path runfiles-root-relative path of the runfile
 * @throws IllegalArgumentException if {@code path} fails validation, for example if it's null orempty, it's absolute or contains uplevel references
 */
public final String rlocation(String path){
  Util.checkArgument(path != null);
  Util.checkArgument(!path.isEmpty());
  Util.checkArgument(!path.contains("String_Node_Str"),"String_Node_Str",path);
  Util.checkArgument(!new File(path).isAbsolute() && path.charAt(0) != File.separatorChar,"String_Node_Str",path);
  return rlocationChecked(path);
}

Fixed version (ground truth):
/** 
 * Returns the runtime path of a runfile (a Bazel-built binary's/test's data-dependency). <p>The returned path may not be valid. The caller should check the path's validity and that the path exists. <p>The function may return null. In that case the caller can be sure that the rule does not know about this data-dependency.
 * @param path runfiles-root-relative path of the runfile
 * @throws IllegalArgumentException if {@code path} fails validation, for example if it's null orempty, or contains uplevel references
 */
public final String rlocation(String path){
  Util.checkArgument(path != null);
  Util.checkArgument(!path.isEmpty());
  Util.checkArgument(!path.contains("String_Node_Str"),"String_Node_Str",path);
  if (new File(path).isAbsolute() || path.charAt(0) == File.separatorChar) {
    return path;
  }
  return rlocationChecked(path);
}