nus-yam/ex-repair huggingface dataset:
Program: 52939
Project: 52939
Buggy source:
private ImmutableList<CxxPreprocessorInput> computePreprocessorInputForCxxLibraryDescriptionArg(BuildRuleParams params,CxxPlatform cxxPlatform,CxxLibraryDescription.CommonArg args,HeaderSymlinkTree headerSymlinkTree,ImmutableList<String> includeDirs,Optional<SymlinkTree> sandboxTree) throws NoSuchBuildTargetException {
  ImmutableSet<BuildRule> deps=args.getCxxDeps().get(ruleResolver,cxxPlatform);
  return CxxDescriptionEnhancer.collectCxxPreprocessorInput(params,cxxPlatform,deps,CxxFlags.getLanguageFlags(args.getPreprocessorFlags(),args.getPlatformPreprocessorFlags(),args.getLangPreprocessorFlags(),cxxPlatform),ImmutableList.of(headerSymlinkTree),ImmutableSet.of(),CxxLibraryDescription.getTransitiveCxxPreprocessorInput(params,ruleResolver,cxxPlatform,deps),includeDirs,sandboxTree);
}

Fixed version (ground truth):
private ImmutableList<CxxPreprocessorInput> computePreprocessorInputForCxxLibraryDescriptionArg(BuildRuleParams params,CxxPlatform cxxPlatform,CxxLibraryDescription.CommonArg args,HeaderSymlinkTree headerSymlinkTree,ImmutableList<String> includeDirs,Optional<SymlinkTree> sandboxTree) throws NoSuchBuildTargetException {
  ImmutableSet<BuildRule> deps=args.getCxxDeps().get(ruleResolver,cxxPlatform);
  return CxxDescriptionEnhancer.collectCxxPreprocessorInput(params,cxxPlatform,deps,CxxFlags.getLanguageFlags(args.getPreprocessorFlags(),args.getPlatformPreprocessorFlags(),args.getLangPreprocessorFlags(),cxxPlatform),ImmutableList.of(headerSymlinkTree),ImmutableSet.of(),CxxLibraryDescription.TransitiveCxxPreprocessorInputFunction.fromLibraryRule().apply(params.getBuildTarget(),ruleResolver,cxxPlatform,deps),includeDirs,sandboxTree);
}
Program: 52940
Project: 52940
Buggy source:
private List<String> buildDotIdeaDotLibrariesFolder(String dotIdea,List<String> inputs){
  String libraries=fileJoin(dotIdea,"String_Node_Str");
  mkdir(libraries);
  Map<String,List<String>> directories=new HashMap<>();
  inputs.stream().filter((input) -> input.endsWith("String_Node_Str")).forEach(jar -> {
    String dirname=dirname(jar);
    String basename=basename(jar);
    List<String> basenames=directories.get(dirname);
    if (basenames == null) {
      basenames=new ArrayList<>();
      directories.put(dirname,basenames);
    }
    basenames.add(basename);
  }
);
  List<String> libraryXmls=new ArrayList<>();
  for (  Map.Entry<String,List<String>> entry : directories.entrySet()) {
    libraryXmls.add(buildLibraryFile(libraries,entry.getKey(),entry.getValue()));
  }
  return libraryXmls;
}

Fixed version (ground truth):
private List<String> buildDotIdeaDotLibrariesFolder(String dotIdea,List<String> inputs){
  String libraries=fileJoin(dotIdea,"String_Node_Str");
  immediateMkdir(libraries);
  Map<String,List<String>> directories=new HashMap<>();
  inputs.stream().filter((input) -> input.endsWith("String_Node_Str")).forEach(jar -> {
    String dirname=dirname(jar);
    String basename=basename(jar);
    List<String> basenames=directories.get(dirname);
    if (basenames == null) {
      basenames=new ArrayList<>();
      directories.put(dirname,basenames);
    }
    basenames.add(basename);
  }
);
  List<String> libraryXmls=new ArrayList<>();
  for (  Map.Entry<String,List<String>> entry : directories.entrySet()) {
    libraryXmls.add(buildLibraryFile(libraries,entry.getKey(),entry.getValue()));
  }
  return libraryXmls;
}
Program: 52941
Project: 52941
Buggy source:
private void buildAllDirectoriesAndSymlinks(){
  Set<Path> deletedDirectories=new HashSet<>();
  for (  Path path : existingDirectories) {
    if (!directoriesToMake.contains(path)) {
      if (dryRun) {
        stderr("String_Node_Str",path);
      }
 else {
        deleteAll(path);
        deletedDirectories.add(path);
      }
    }
  }
  for (  Path path : directoriesToMake) {
    if (!existingDirectories.contains(path)) {
      if (dryRun) {
        stderr("String_Node_Str",path);
      }
 else {
        try {
          Files.createDirectories(path);
        }
 catch (        IOException e) {
          stderr("String_Node_Str",e.getMessage(),path);
        }
      }
    }
  }
  existingSymlinks.forEach((filePath,linkPath) -> {
    if (linkPath.equals(symlinksToCreate.get(filePath))) {
      symlinksToCreate.remove(filePath);
    }
 else {
      if (dryRun) {
        stderr("String_Node_Str",linkPath);
      }
 else {
        try {
          Files.delete(linkPath);
        }
 catch (        IOException e) {
          if (!linkInDeletedDirectories(deletedDirectories,linkPath)) {
            stderr("String_Node_Str",e.getMessage(),linkPath);
          }
        }
      }
    }
  }
);
  symlinksToCreate.forEach((filePath,linkPath) -> {
    if (dryRun) {
      stderr("String_Node_Str",filePath,linkPath);
    }
 else {
      createSymbolicLink(filePath,linkPath);
    }
  }
);
}

Fixed version (ground truth):
private void buildAllDirectoriesAndSymlinks(){
  Set<Path> deletedDirectories=new HashSet<>();
  for (  Path path : existingDirectories) {
    if (!directoriesToMake.contains(path)) {
      if (dryRun) {
        stderr("String_Node_Str",path);
      }
 else {
        deleteAll(path);
        deletedDirectories.add(path);
      }
    }
  }
  for (  Path path : directoriesToMake) {
    if (!existingDirectories.contains(path)) {
      immediateMkdir(path);
    }
  }
  existingSymlinks.forEach((filePath,linkPath) -> {
    if (linkPath.equals(symlinksToCreate.get(filePath))) {
      symlinksToCreate.remove(filePath);
    }
 else {
      if (dryRun) {
        stderr("String_Node_Str",linkPath);
      }
 else {
        try {
          Files.delete(linkPath);
        }
 catch (        IOException e) {
          if (!linkInDeletedDirectories(deletedDirectories,linkPath)) {
            stderr("String_Node_Str",e.getMessage(),linkPath);
          }
        }
      }
    }
  }
);
  symlinksToCreate.forEach((filePath,linkPath) -> {
    if (dryRun) {
      stderr("String_Node_Str",filePath,linkPath);
    }
 else {
      createSymbolicLink(filePath,linkPath);
    }
  }
);
}
Program: 52942
Project: 52942
Buggy source:
private List<String> buildDotIdeaFolder(List<String> inputs){
  String dotIdea=fileJoin(viewPath,DOT_IDEA);
  mkdir(dotIdea);
  writeModulesXml(dotIdea);
  writeMiscXml(dotIdea);
  symlink(fileJoin(repository,DOT_IDEA,CODE_STYLE_SETTINGS),fileJoin(dotIdea,CODE_STYLE_SETTINGS));
  return buildDotIdeaDotLibrariesFolder(dotIdea,inputs);
}

Fixed version (ground truth):
private List<String> buildDotIdeaFolder(List<String> inputs){
  String dotIdea=fileJoin(viewPath,DOT_IDEA);
  immediateMkdir(dotIdea);
  writeModulesXml(dotIdea);
  writeMiscXml(dotIdea);
  symlink(fileJoin(repository,DOT_IDEA,CODE_STYLE_SETTINGS),fileJoin(dotIdea,CODE_STYLE_SETTINGS));
  return buildDotIdeaDotLibrariesFolder(dotIdea,inputs);
}
Program: 52943
Project: 52943
Buggy source:
private Map<BuildTarget,String> getOutputs(){
  Map<BuildTarget,String> outputs=new HashMap<>();
  ActionGraphAndResolver actionGraph=ActionGraphCache.getFreshActionGraph(eventBus,targetGraph);
  BuildRuleResolver ruleResolver=actionGraph.getResolver();
  SourcePathResolver pathResolver=new SourcePathResolver(new SourcePathRuleFinder(ruleResolver));
  for (  BuildTarget target : buildTargets) {
    BuildRule rule=ruleResolver.getRule(target);
    Path outputPath=pathResolver.getRelativePath(rule.getSourcePathToOutput());
    outputs.put(target,outputPath.toString());
  }
  return outputs;
}

Fixed version (ground truth):
private Map<BuildTarget,String> getOutputs(){
  Map<BuildTarget,String> outputs=new HashMap<>(buildTargets.size());
  ActionGraphAndResolver actionGraph=ActionGraphCache.getFreshActionGraph(eventBus,targetGraph);
  BuildRuleResolver ruleResolver=actionGraph.getResolver();
  SourcePathResolver pathResolver=new SourcePathResolver(new SourcePathRuleFinder(ruleResolver));
  for (  BuildTarget target : buildTargets) {
    BuildRule rule=ruleResolver.getRule(target);
    SourcePath sourcePathToOutput=rule.getSourcePathToOutput();
    if (sourcePathToOutput == null) {
      continue;
    }
    Path outputPath=pathResolver.getRelativePath(sourcePathToOutput);
    outputs.put(target,outputPath.toString());
  }
  return outputs;
}
Program: 52947
Project: 52947
Buggy source:
@VisibleForTesting static Manifest fromMap(ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> map){
  Manifest manifest=new Manifest();
  for (  Map.Entry<RuleKey,ImmutableMap<String,HashCode>> entry : map.entrySet()) {
    int entryHashIndex=0;
    int[] entryHashIndices=new int[entry.getValue().size()];
    for (    Map.Entry<String,HashCode> innerEntry : entry.getValue().entrySet()) {
      entryHashIndices[entryHashIndex++]=manifest.addHash(innerEntry.getKey(),innerEntry.getValue());
    }
    manifest.entries.add(new Pair<>(entry.getKey(),entryHashIndices));
  }
  return manifest;
}

Fixed version (ground truth):
@VisibleForTesting static Manifest fromMap(RuleKey key,ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> map){
  Manifest manifest=new Manifest(key);
  for (  Map.Entry<RuleKey,ImmutableMap<String,HashCode>> entry : map.entrySet()) {
    int entryHashIndex=0;
    int[] entryHashIndices=new int[entry.getValue().size()];
    for (    Map.Entry<String,HashCode> innerEntry : entry.getValue().entrySet()) {
      entryHashIndices[entryHashIndex++]=manifest.addHash(innerEntry.getKey(),innerEntry.getValue());
    }
    manifest.entries.add(new Pair<>(entry.getKey(),entryHashIndices));
  }
  return manifest;
}
Program: 52948
Project: 52948
Buggy source:
/** 
 * Deserialize an existing manifest from the given   {@link InputStream}.
 */
public Manifest(InputStream rawInput) throws IOException {
  DataInputStream input=new DataInputStream(rawInput);
  Preconditions.checkState(input.readInt() == VERSION);
  int numberOfHeaders=input.readInt();
  headers=new ArrayList<>(numberOfHeaders);
  headerIndices=new HashMap<>(numberOfHeaders);
  for (int index=0; index < numberOfHeaders; index++) {
    String header=input.readUTF();
    headers.add(header);
    headerIndices.put(header,index);
  }
  int numberOfHashes=input.readInt();
  hashes=new ArrayList<>(numberOfHashes);
  hashIndices=new HashMap<>(numberOfHashes);
  for (int index=0; index < numberOfHashes; index++) {
    int headerIndex=input.readInt();
    HashCode headerHash=HashCode.fromString(input.readUTF());
    hashes.add(new Pair<>(headerIndex,headerHash));
    hashIndices.put(headerHash,index);
  }
  int numberOfEntries=input.readInt();
  entries=new ArrayList<>(numberOfEntries);
  for (int entryIndex=0; entryIndex < numberOfEntries; entryIndex++) {
    int numberOfEntryHashes=input.readInt();
    int[] entryHashes=new int[numberOfEntryHashes];
    for (int hashIndex=0; hashIndex < numberOfEntryHashes; hashIndex++) {
      entryHashes[hashIndex]=input.readInt();
    }
    RuleKey key=new RuleKey(input.readUTF());
    entries.add(new Pair<>(key,entryHashes));
  }
}

Fixed version (ground truth):
/** 
 * Deserialize an existing manifest from the given   {@link InputStream}.
 */
public Manifest(InputStream rawInput) throws IOException {
  DataInputStream input=new DataInputStream(rawInput);
  int version=input.readInt();
  Preconditions.checkState(version == VERSION,"String_Node_Str",version,VERSION);
  key=new RuleKey(input.readUTF());
  int numberOfHeaders=input.readInt();
  headers=new ArrayList<>(numberOfHeaders);
  headerIndices=new HashMap<>(numberOfHeaders);
  for (int index=0; index < numberOfHeaders; index++) {
    String header=input.readUTF();
    headers.add(header);
    headerIndices.put(header,index);
  }
  int numberOfHashes=input.readInt();
  hashes=new ArrayList<>(numberOfHashes);
  hashIndices=new HashMap<>(numberOfHashes);
  for (int index=0; index < numberOfHashes; index++) {
    int headerIndex=input.readInt();
    HashCode headerHash=HashCode.fromString(input.readUTF());
    hashes.add(new Pair<>(headerIndex,headerHash));
    hashIndices.put(headerHash,index);
  }
  int numberOfEntries=input.readInt();
  entries=new ArrayList<>(numberOfEntries);
  for (int entryIndex=0; entryIndex < numberOfEntries; entryIndex++) {
    int numberOfEntryHashes=input.readInt();
    int[] entryHashes=new int[numberOfEntryHashes];
    for (int hashIndex=0; hashIndex < numberOfEntryHashes; hashIndex++) {
      entryHashes[hashIndex]=input.readInt();
    }
    RuleKey key=new RuleKey(input.readUTF());
    entries.add(new Pair<>(key,entryHashes));
  }
}
Program: 52949
Project: 52949
Buggy source:
/** 
 * Serializes the manifest to the given   {@link OutputStream}.
 */
public void serialize(OutputStream rawOutput) throws IOException {
  DataOutputStream output=new DataOutputStream(rawOutput);
  output.writeInt(VERSION);
  output.writeInt(headers.size());
  for (  String header : headers) {
    output.writeUTF(header);
  }
  output.writeInt(hashes.size());
  for (  Pair<Integer,HashCode> hash : hashes) {
    output.writeInt(hash.getFirst());
    output.writeUTF(hash.getSecond().toString());
  }
  output.writeInt(entries.size());
  for (  Pair<RuleKey,int[]> entry : entries) {
    output.writeInt(entry.getSecond().length);
    for (    int hashIndex : entry.getSecond()) {
      output.writeInt(hashIndex);
    }
    output.writeUTF(entry.getFirst().toString());
  }
}

Fixed version (ground truth):
/** 
 * Serializes the manifest to the given   {@link OutputStream}.
 */
public void serialize(OutputStream rawOutput) throws IOException {
  DataOutputStream output=new DataOutputStream(rawOutput);
  output.writeInt(VERSION);
  output.writeUTF(key.toString());
  output.writeInt(headers.size());
  for (  String header : headers) {
    output.writeUTF(header);
  }
  output.writeInt(hashes.size());
  for (  Pair<Integer,HashCode> hash : hashes) {
    output.writeInt(hash.getFirst());
    output.writeUTF(hash.getSecond().toString());
  }
  output.writeInt(entries.size());
  for (  Pair<RuleKey,int[]> entry : entries) {
    output.writeInt(entry.getSecond().length);
    for (    int hashIndex : entry.getSecond()) {
      output.writeInt(hashIndex);
    }
    output.writeUTF(entry.getFirst().toString());
  }
}
Program: 52953
Project: 52953
Buggy source:
@Test public void serialize() throws IOException {
  ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> entries=ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(20)));
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  Manifest.fromMap(entries).serialize(byteArrayOutputStream);
  Manifest deserialized=new Manifest(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()));
  assertThat(deserialized.toMap(),Matchers.equalTo(entries));
}

Fixed version (ground truth):
@Test public void serialize() throws IOException {
  ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> entries=ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(20)));
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  Manifest.fromMap(new RuleKey("String_Node_Str"),entries).serialize(byteArrayOutputStream);
  Manifest deserialized=new Manifest(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()));
  assertThat(deserialized.toMap(),Matchers.equalTo(entries));
}
Program: 52954
Project: 52954
Buggy source:
@Test public void lookupHashMismatch() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),HashCode.fromInt(2)));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.empty()));
}

Fixed version (ground truth):
@Test public void lookupHashMismatch() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),HashCode.fromInt(2)));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.empty()));
}
Program: 52955
Project: 52955
Buggy source:
@Test public void addEntry() throws IOException {
  Manifest manifest=new Manifest();
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  HashCode hashCode=HashCode.fromInt(20);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),hashCode));
  manifest.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input),ImmutableSet.of(input));
  assertThat(manifest.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),hashCode))));
}

Fixed version (ground truth):
@Test public void addEntry() throws IOException {
  Manifest manifest=new Manifest(new RuleKey("String_Node_Str"));
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  HashCode hashCode=HashCode.fromInt(20);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),hashCode));
  manifest.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input),ImmutableSet.of(input));
  assertThat(manifest.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),hashCode))));
}
Program: 52956
Project: 52956
Buggy source:
@Test public void size(){
  assertThat(new Manifest().size(),Matchers.equalTo(0));
  assertThat(Manifest.fromMap(ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)))).size(),Matchers.equalTo(1));
  assertThat(Manifest.fromMap(ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)),new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)))).size(),Matchers.equalTo(2));
}

Fixed version (ground truth):
@Test public void size(){
  assertThat(new Manifest(new RuleKey("String_Node_Str")).size(),Matchers.equalTo(0));
  assertThat(Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)))).size(),Matchers.equalTo(1));
  assertThat(Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)),new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(0)))).size(),Matchers.equalTo(2));
}
Program: 52957
Project: 52957
Buggy source:
@Test public void addEntryWithSourcePathsThatHaveSameRelativePaths() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  Path tmp1=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem1=new FakeProjectFilesystem(tmp1);
  SourcePath input1=new PathSourcePath(filesystem1,Paths.get("String_Node_Str"));
  HashCode hashCode1=HashCode.fromInt(1);
  Path tmp2=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem2=new FakeProjectFilesystem(tmp2);
  SourcePath input2=new PathSourcePath(filesystem2,Paths.get("String_Node_Str"));
  HashCode hashCode2=HashCode.fromInt(1);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input1),hashCode1,RESOLVER.getAbsolutePath(input2),hashCode2));
  Manifest manifest1=new Manifest();
  manifest1.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input1,input2),ImmutableSet.of(input1));
  assertThat(manifest1.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input1).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2))))));
  Manifest manifest2=new Manifest();
  manifest2.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input1,input2),ImmutableSet.of(input2));
  assertThat(manifest2.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input2).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2))))));
}

Fixed version (ground truth):
@Test public void addEntryWithSourcePathsThatHaveSameRelativePaths() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  Path tmp1=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem1=new FakeProjectFilesystem(tmp1);
  SourcePath input1=new PathSourcePath(filesystem1,Paths.get("String_Node_Str"));
  HashCode hashCode1=HashCode.fromInt(1);
  Path tmp2=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem2=new FakeProjectFilesystem(tmp2);
  SourcePath input2=new PathSourcePath(filesystem2,Paths.get("String_Node_Str"));
  HashCode hashCode2=HashCode.fromInt(1);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input1),hashCode1,RESOLVER.getAbsolutePath(input2),hashCode2));
  Manifest manifest1=new Manifest(new RuleKey("String_Node_Str"));
  manifest1.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input1,input2),ImmutableSet.of(input1));
  assertThat(manifest1.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input1).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2))))));
  Manifest manifest2=new Manifest(new RuleKey("String_Node_Str"));
  manifest2.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input1,input2),ImmutableSet.of(input2));
  assertThat(manifest2.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input2).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2))))));
}
Program: 52958
Project: 52958
Buggy source:
@Test public void lookupMissingHeader() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of());
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.empty()));
}

Fixed version (ground truth):
@Test public void lookupMissingHeader() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of());
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.empty()));
}
Program: 52959
Project: 52959
Buggy source:
@Test public void toMap(){
  ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> entries=ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(20)));
  assertThat(Manifest.fromMap(entries).toMap(),Matchers.equalTo(entries));
}

Fixed version (ground truth):
@Test public void toMap(){
  ImmutableMap<RuleKey,ImmutableMap<String,HashCode>> entries=ImmutableMap.of(new RuleKey("String_Node_Str"),ImmutableMap.of("String_Node_Str",HashCode.fromInt(20)));
  assertThat(Manifest.fromMap(new RuleKey("String_Node_Str"),entries).toMap(),Matchers.equalTo(entries));
}
Program: 52960
Project: 52960
Buggy source:
@Test public void lookupMatchWithSourcePathsThatHaveSameRelativePaths() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  Path tmp1=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem1=new FakeProjectFilesystem(tmp1);
  SourcePath input1=new PathSourcePath(filesystem1,Paths.get("String_Node_Str"));
  HashCode hashCode1=HashCode.fromInt(1);
  Path tmp2=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem2=new FakeProjectFilesystem(tmp2);
  SourcePath input2=new PathSourcePath(filesystem2,Paths.get("String_Node_Str"));
  HashCode hashCode2=HashCode.fromInt(1);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input1),hashCode1,RESOLVER.getAbsolutePath(input2),hashCode2));
  Manifest manifest1=Manifest.fromMap(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input1).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2)))));
  assertThat(manifest1.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input1,input2)),Matchers.equalTo(Optional.of(key)));
  Manifest manifest2=Manifest.fromMap(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input2).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2)))));
  assertThat(manifest2.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input1,input2)),Matchers.equalTo(Optional.of(key)));
}

Fixed version (ground truth):
@Test public void lookupMatchWithSourcePathsThatHaveSameRelativePaths() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  Path tmp1=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem1=new FakeProjectFilesystem(tmp1);
  SourcePath input1=new PathSourcePath(filesystem1,Paths.get("String_Node_Str"));
  HashCode hashCode1=HashCode.fromInt(1);
  Path tmp2=Files.createTempDirectory("String_Node_Str");
  ProjectFilesystem filesystem2=new FakeProjectFilesystem(tmp2);
  SourcePath input2=new PathSourcePath(filesystem2,Paths.get("String_Node_Str"));
  HashCode hashCode2=HashCode.fromInt(1);
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input1),hashCode1,RESOLVER.getAbsolutePath(input2),hashCode2));
  Manifest manifest1=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input1).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2)))));
  assertThat(manifest1.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input1,input2)),Matchers.equalTo(Optional.of(key)));
  Manifest manifest2=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input2).toString(),Manifest.hashSourcePathGroup(fileHashCache,RESOLVER,ImmutableList.of(input1,input2)))));
  assertThat(manifest2.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input1,input2)),Matchers.equalTo(Optional.of(key)));
}
Program: 52961
Project: 52961
Buggy source:
@Test public void emptyManifest(){
  assertThat(new Manifest().toMap().entrySet(),Matchers.empty());
}

Fixed version (ground truth):
@Test public void emptyManifest(){
  assertThat(new Manifest(new RuleKey("String_Node_Str")).toMap().entrySet(),Matchers.empty());
}
Program: 52962
Project: 52962
Buggy source:
@Test public void lookupMatchAfterHashMismatch() throws IOException {
  RuleKey key1=new RuleKey("String_Node_Str");
  RuleKey key2=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(ImmutableMap.of(key1,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1)),key2,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(2))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),HashCode.fromInt(2)));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.of(key2)));
}

Fixed version (ground truth):
@Test public void lookupMatchAfterHashMismatch() throws IOException {
  RuleKey key1=new RuleKey("String_Node_Str");
  RuleKey key2=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  Manifest manifest=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key1,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(1)),key2,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),HashCode.fromInt(2))));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),HashCode.fromInt(2)));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.of(key2)));
}
Program: 52963
Project: 52963
Buggy source:
@Test public void lookupMatch() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  HashCode hashCode=HashCode.fromInt(20);
  Manifest manifest=Manifest.fromMap(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),hashCode)));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),hashCode));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.of(key)));
}

Fixed version (ground truth):
@Test public void lookupMatch() throws IOException {
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new FakeSourcePath("String_Node_Str");
  HashCode hashCode=HashCode.fromInt(20);
  Manifest manifest=Manifest.fromMap(new RuleKey("String_Node_Str"),ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativePath(input).toString(),hashCode)));
  FileHashCache fileHashCache=new FakeFileHashCache(ImmutableMap.of(RESOLVER.getAbsolutePath(input),hashCode));
  assertThat(manifest.lookup(fileHashCache,RESOLVER,ImmutableSet.of(input)),Matchers.equalTo(Optional.of(key)));
}
Program: 52964
Project: 52964
Buggy source:
@Test public void addEntryFromArchive() throws IOException {
  Manifest manifest=new Manifest();
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new ArchiveMemberSourcePath(new FakeSourcePath("String_Node_Str"),Paths.get("String_Node_Str"));
  HashCode hashCode=HashCode.fromInt(20);
  FileHashCache fileHashCache=new FakeFileHashCache(new HashMap<>(),ImmutableMap.of(RESOLVER.getAbsoluteArchiveMemberPath(input),hashCode),new HashMap<>());
  manifest.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input),ImmutableSet.of(input));
  assertThat(manifest.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativeArchiveMemberPath(input).toString(),hashCode))));
}

Fixed version (ground truth):
@Test public void addEntryFromArchive() throws IOException {
  Manifest manifest=new Manifest(new RuleKey("String_Node_Str"));
  RuleKey key=new RuleKey("String_Node_Str");
  SourcePath input=new ArchiveMemberSourcePath(new FakeSourcePath("String_Node_Str"),Paths.get("String_Node_Str"));
  HashCode hashCode=HashCode.fromInt(20);
  FileHashCache fileHashCache=new FakeFileHashCache(new HashMap<>(),ImmutableMap.of(RESOLVER.getAbsoluteArchiveMemberPath(input),hashCode),new HashMap<>());
  manifest.addEntry(fileHashCache,key,RESOLVER,ImmutableSet.of(input),ImmutableSet.of(input));
  assertThat(manifest.toMap(),Matchers.equalTo(ImmutableMap.of(key,ImmutableMap.of(RESOLVER.getRelativeArchiveMemberPath(input).toString(),hashCode))));
}
Program: 52966
Project: 52966
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean first=true;
  if (isSetCellName()) {
    sb.append("String_Node_Str");
    if (this.cellName == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.cellName);
    }
    first=false;
  }
  if (!first)   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (this.baseName == null) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append(this.baseName);
  }
  first=false;
  if (!first)   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (this.shortName == null) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append(this.shortName);
  }
  first=false;
  if (!first)   sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (this.flavors == null) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append(this.flavors);
  }
  first=false;
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean first=true;
  if (isSetCellName()) {
    sb.append("String_Node_Str");
    if (this.cellName == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.cellName);
    }
    first=false;
  }
  if (isSetBaseName()) {
    if (!first)     sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (this.baseName == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.baseName);
    }
    first=false;
  }
  if (isSetShortName()) {
    if (!first)     sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (this.shortName == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.shortName);
    }
    first=false;
  }
  if (isSetFlavors()) {
    if (!first)     sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (this.flavors == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.flavors);
    }
    first=false;
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 52967
Project: 52967
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean first=true;
  sb.append("String_Node_Str");
  if (this.path == null) {
    sb.append("String_Node_Str");
  }
 else {
    sb.append(this.path);
  }
  first=false;
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean first=true;
  if (isSetPath()) {
    sb.append("String_Node_Str");
    if (this.path == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(this.path);
    }
    first=false;
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 52968
Project: 52968
Buggy source:
private List<PathWithUnixSeparators> processDirectory(Path path,Queue<Path> remainingPaths) throws IOException {
  List<PathWithUnixSeparators> childrenRelativePaths=new ArrayList<>();
  for (  Path relativeChildPath : projectFilesystem.getDirectoryContents(path)) {
    childrenRelativePaths.add(new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(relativeChildPath)));
    remainingPaths.add(relativeChildPath);
  }
  return childrenRelativePaths;
}

Fixed version (ground truth):
private List<PathWithUnixSeparators> processDirectory(Path path,Queue<Path> remainingPaths) throws IOException {
  List<PathWithUnixSeparators> childrenRelativePaths=new ArrayList<>();
  for (  Path relativeChildPath : projectFilesystem.getDirectoryContents(path)) {
    childrenRelativePaths.add(new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(relativeChildPath)));
    remainingPaths.add(relativeChildPath);
  }
  return childrenRelativePaths;
}
Program: 52971
Project: 52971
Buggy source:
private static PathWithUnixSeparators unixPath(Path path){
  return new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(path));
}

Fixed version (ground truth):
private static PathWithUnixSeparators unixPath(Path path){
  return new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(path));
}
Program: 52972
Project: 52972
Buggy source:
private static PathWithUnixSeparators unixPath(String path){
  return new PathWithUnixSeparators(MorePaths.pathWithUnixSeparators(path));
}

Fixed version (ground truth):
private static PathWithUnixSeparators unixPath(String path){
  return new PathWithUnixSeparators().setPath(MorePaths.pathWithUnixSeparators(path));
}
Program: 52973
Project: 52973
Buggy source:
public Optional<String> getValue(String sectionName,String propertyName){
  return config.getValue(sectionName,propertyName);
}

Fixed version (ground truth):
/** 
 * @return the string value for the config settings, where present empty values are{@code Optional.empty()}.
 */
public Optional<String> getValue(String sectionName,String propertyName){
  return config.getValue(sectionName,propertyName);
}
Program: 52974
Project: 52974
Buggy source:
void invalidateIfBuckConfigHasChanged(Cell cell,Path buildFile){
  ImmutableMap<String,ImmutableMap<String,Optional<String>>> usedConfigs;
  try (AutoCloseableLock readLock=rawAndComputedNodesLock.readLock()){
    usedConfigs=buildFileConfigs.get(buildFile);
  }
   if (usedConfigs == null) {
    this.cell.set(cell);
    return;
  }
  for (  Map.Entry<String,ImmutableMap<String,Optional<String>>> keyEnt : usedConfigs.entrySet()) {
    for (    Map.Entry<String,Optional<String>> valueEnt : keyEnt.getValue().entrySet()) {
      Optional<String> value=cell.getBuckConfig().getValue(keyEnt.getKey(),valueEnt.getKey());
      if (!value.equals(valueEnt.getValue())) {
        invalidatePath(buildFile);
        this.cell.set(cell);
        return;
      }
    }
  }
}

Fixed version (ground truth):
void invalidateIfBuckConfigHasChanged(Cell cell,Path buildFile){
  ImmutableMap<String,ImmutableMap<String,Optional<String>>> usedConfigs;
  try (AutoCloseableLock readLock=rawAndComputedNodesLock.readLock()){
    usedConfigs=buildFileConfigs.get(buildFile);
  }
   if (usedConfigs == null) {
    this.cell.set(cell);
    return;
  }
  for (  Map.Entry<String,ImmutableMap<String,Optional<String>>> keyEnt : usedConfigs.entrySet()) {
    for (    Map.Entry<String,Optional<String>> valueEnt : keyEnt.getValue().entrySet()) {
      Optional<String> value=cell.getBuckConfig().getRawValue(keyEnt.getKey(),valueEnt.getKey());
      if (!value.equals(valueEnt.getValue())) {
        invalidatePath(buildFile);
        this.cell.set(cell);
        return;
      }
    }
  }
}
Program: 52975
Project: 52975
Buggy source:
@Override public int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  Stopwatch stopwatch=Stopwatch.createStarted();
  Console console=params.getConsole();
  try (DistBuildService service=DistBuildFactory.newDistBuildService(params)){
    Pair<BuildJobState,String> jobStateAndBuildName=getBuildJobStateAndBuildName(params.getCell().getFilesystem(),console,service);
    BuildJobState jobState=jobStateAndBuildName.getFirst();
    String buildName=jobStateAndBuildName.getSecond();
    console.getStdOut().println(String.format("String_Node_Str",jobState.getFileHashesSize()));
    try (CommandThreadManager pool=new CommandThreadManager(getClass().getName(),getConcurrencyLimit(params.getBuckConfig()))){
      DistBuildSlaveExecutor distBuildExecutor=DistBuildFactory.createDistBuildExecutor(jobState,params,pool.getExecutor(),service,Preconditions.checkNotNull(distBuildMode),coordinatorPort,getStampedeIdOptional(),getGlobalCacheDirOptional());
      int returnCode=distBuildExecutor.buildAndReturnExitCode();
      console.printSuccess(String.format("String_Node_Str",buildName,stopwatch.elapsed(TimeUnit.MILLISECONDS)));
      return returnCode;
    }
   }
 }

Fixed version (ground truth):
@Override public int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  Stopwatch stopwatch=Stopwatch.createStarted();
  Console console=params.getConsole();
  try (DistBuildService service=DistBuildFactory.newDistBuildService(params)){
    Pair<BuildJobState,String> jobStateAndBuildName=getBuildJobStateAndBuildName(params.getCell().getFilesystem(),console,service);
    BuildJobState jobState=jobStateAndBuildName.getFirst();
    String buildName=jobStateAndBuildName.getSecond();
    console.getStdOut().println(String.format("String_Node_Str",jobState.getFileHashesSize()));
    try (CommandThreadManager pool=new CommandThreadManager(getClass().getName(),getConcurrencyLimit(params.getBuckConfig()))){
      DistBuildSlaveExecutor distBuildExecutor=DistBuildFactory.createDistBuildExecutor(jobState,params,pool.getExecutor(),service,Preconditions.checkNotNull(distBuildMode),coordinatorPort,getStampedeIdOptional(),getGlobalCacheDirOptional());
      int returnCode=distBuildExecutor.buildAndReturnExitCode();
      if (returnCode == 0) {
        console.printSuccess(String.format("String_Node_Str",buildName,stopwatch.elapsed(TimeUnit.MILLISECONDS)));
      }
 else {
        console.printErrorText("String_Node_Str",buildName,stopwatch.elapsed(TimeUnit.MILLISECONDS));
      }
      return returnCode;
    }
   }
 }
Program: 52976
Project: 52976
Buggy source:
public List<BuildJobStateFileHashes> getFileHashes() throws IOException, InterruptedException {
  try {
    return fileHashes.get().stream().filter(x -> x.getEntriesSize() > 0).collect(Collectors.toList());
  }
 catch (  ExecutionException e) {
    Throwables.throwIfInstanceOf(e.getCause(),IOException.class);
    Throwables.throwIfInstanceOf(e.getCause(),InterruptedException.class);
    throw new RuntimeException(e.getCause());
  }
}

Fixed version (ground truth):
public List<BuildJobStateFileHashes> getFileHashes() throws IOException, InterruptedException {
  try {
    return fileHashes.get();
  }
 catch (  ExecutionException e) {
    Throwables.throwIfInstanceOf(e.getCause(),IOException.class);
    Throwables.throwIfInstanceOf(e.getCause(),InterruptedException.class);
    throw new RuntimeException(e.getCause());
  }
}
Program: 52977
Project: 52977
Buggy source:
private DistBuildCachingEngineDelegate createBuildEngineDelegate() throws IOException, InterruptedException {
  if (cachingBuildEngineDelegate != null) {
    return cachingBuildEngineDelegate;
  }
  ImmutableList.Builder<MaterializerProjectFileHashCache> allCachesBuilder=ImmutableList.builder();
  Cell rootCell=args.getState().getRootCell();
  for (  Path cellPath : rootCell.getKnownRoots()) {
    Cell cell=rootCell.getCell(cellPath);
    allCachesBuilder.add(args.getState().createMaterializer(cell.getFilesystem(),args.getProvider()));
  }
  allCachesBuilder.add(args.getState().createMaterializer(rootCell.getFilesystem(),args.getProvider()));
  ImmutableList<MaterializerProjectFileHashCache> allCaches=allCachesBuilder.build();
  StackedFileHashCache stackedFileHashCache=new StackedFileHashCache(allCaches);
  for (  MaterializerProjectFileHashCache materializer : allCaches) {
    materializer.preloadAllFiles();
  }
  createActionGraphAndResolver();
  SourcePathRuleFinder ruleFinder=new SourcePathRuleFinder(Preconditions.checkNotNull(actionGraphAndResolver).getResolver());
  cachingBuildEngineDelegate=new DistBuildCachingEngineDelegate(new SourcePathResolver(ruleFinder),ruleFinder,args.getState(),stackedFileHashCache);
  return cachingBuildEngineDelegate;
}

Fixed version (ground truth):
private DistBuildCachingEngineDelegate createBuildEngineDelegate() throws IOException, InterruptedException {
  if (cachingBuildEngineDelegate != null) {
    return cachingBuildEngineDelegate;
  }
  ImmutableList.Builder<ProjectFileHashCache> allCachesBuilder=ImmutableList.builder();
  Cell rootCell=args.getState().getRootCell();
  for (  Path cellPath : rootCell.getKnownRoots()) {
    Cell cell=rootCell.getCell(cellPath);
    allCachesBuilder.add(args.getState().createMaterializer(cell.getFilesystem(),args.getProvider()));
  }
  allCachesBuilder.addAll(DefaultFileHashCache.createOsRootDirectoriesCaches());
  StackedFileHashCache stackedFileHashCache=new StackedFileHashCache(allCachesBuilder.build());
  createActionGraphAndResolver();
  SourcePathRuleFinder ruleFinder=new SourcePathRuleFinder(Preconditions.checkNotNull(actionGraphAndResolver).getResolver());
  cachingBuildEngineDelegate=new DistBuildCachingEngineDelegate(new SourcePathResolver(ruleFinder),ruleFinder,args.getState(),stackedFileHashCache);
  return cachingBuildEngineDelegate;
}
Program: 52978
Project: 52978
Buggy source:
public MaterializerProjectFileHashCache createMaterializer(ProjectFilesystem projectFilesystem,FileContentsProvider provider){
  BuildJobStateFileHashes remoteFileHashes=Preconditions.checkNotNull(fileHashes.get(projectFilesystem),"String_Node_Str",projectFilesystem);
  return new MaterializerProjectFileHashCache(projectFilesystem,remoteFileHashes,provider,new StackedFileHashCache(loadDirectFileHashCache(projectFilesystem)));
}

Fixed version (ground truth):
public MaterializerProjectFileHashCache createMaterializer(ProjectFilesystem projectFilesystem,FileContentsProvider provider) throws IOException {
  BuildJobStateFileHashes remoteFileHashes=Preconditions.checkNotNull(fileHashes.get(projectFilesystem),"String_Node_Str",projectFilesystem);
  MaterializerProjectFileHashCache materializer=new MaterializerProjectFileHashCache(projectFilesystem,remoteFileHashes,provider,new StackedFileHashCache(loadDirectFileHashCache(projectFilesystem)));
  materializer.preloadAllFiles();
  return materializer;
}
Program: 52980
Project: 52980
Buggy source:
@Test public void recordsFileHashes() throws Exception {
  SingleFileFixture f=new SingleFileFixture(tempDir);
  List<BuildJobStateFileHashes> recordedHashes=f.distributedBuildFileHashes.getFileHashes();
  assertThat(recordedHashes,Matchers.hasSize(1));
  BuildJobStateFileHashes hashes=recordedHashes.get(0);
  assertThat(hashes.entries,Matchers.hasSize(1));
  BuildJobStateFileHashEntry fileHashEntry=hashes.entries.get(0);
  assertThat(fileHashEntry.getPath().getPath(),Matchers.equalTo("String_Node_Str"));
  assertFalse(fileHashEntry.isPathIsAbsolute());
  assertFalse(fileHashEntry.isIsDirectory());
}

Fixed version (ground truth):
@Test public void recordsFileHashes() throws Exception {
  SingleFileFixture f=new SingleFileFixture(tempDir);
  List<BuildJobStateFileHashes> recordedHashes=f.distributedBuildFileHashes.getFileHashes();
  assertThat(recordedHashes,Matchers.hasSize(3));
  BuildJobStateFileHashes rootCellHashes=getRootCellHashes(recordedHashes);
  assertThat(rootCellHashes.entries,Matchers.hasSize(1));
  BuildJobStateFileHashEntry fileHashEntry=rootCellHashes.entries.get(0);
  assertThat(fileHashEntry.getPath().getPath(),Matchers.equalTo("String_Node_Str"));
  assertFalse(fileHashEntry.isPathIsAbsolute());
  assertFalse(fileHashEntry.isIsDirectory());
}
Program: 52981
Project: 52981
Buggy source:
@Test public void recordsArchiveHashes() throws Exception {
  try (ArchiveFilesFixture f=ArchiveFilesFixture.create(archiveTempDir)){
    List<BuildJobStateFileHashes> recordedHashes=f.distributedBuildFileHashes.getFileHashes();
    assertThat(recordedHashes,Matchers.hasSize(1));
    BuildJobStateFileHashes hashes=recordedHashes.get(0);
    assertThat(hashes.entries,Matchers.hasSize(1));
    BuildJobStateFileHashEntry fileHashEntry=hashes.entries.get(0);
    assertThat(fileHashEntry.getPath().getPath(),Matchers.equalTo("String_Node_Str"));
    assertTrue(fileHashEntry.isSetArchiveMemberPath());
    assertThat(fileHashEntry.getArchiveMemberPath(),Matchers.equalTo("String_Node_Str"));
    assertFalse(fileHashEntry.isPathIsAbsolute());
    assertFalse(fileHashEntry.isIsDirectory());
  }
 }

Fixed version (ground truth):
@Test public void recordsArchiveHashes() throws Exception {
  try (ArchiveFilesFixture f=ArchiveFilesFixture.create(archiveTempDir)){
    List<BuildJobStateFileHashes> recordedHashes=f.distributedBuildFileHashes.getFileHashes();
    assertThat(recordedHashes,Matchers.hasSize(3));
    BuildJobStateFileHashes hashes=getRootCellHashes(recordedHashes);
    assertThat(hashes.entries,Matchers.hasSize(1));
    BuildJobStateFileHashEntry fileHashEntry=hashes.entries.get(0);
    assertThat(fileHashEntry.getPath().getPath(),Matchers.equalTo("String_Node_Str"));
    assertTrue(fileHashEntry.isSetArchiveMemberPath());
    assertThat(fileHashEntry.getArchiveMemberPath(),Matchers.equalTo("String_Node_Str"));
    assertFalse(fileHashEntry.isPathIsAbsolute());
    assertFalse(fileHashEntry.isIsDirectory());
  }
 }
Program: 52982
Project: 52982
Buggy source:
@SuppressWarnings("String_Node_Str") private void submitTraceEvent(final ChromeTraceEvent chromeTraceEvent){
  outputExecutor.submit(new Callable<Void>(){
    @Override public Void call() throws Exception {
      try {
        mapper.writeValue(jsonGenerator,chromeTraceEvent);
      }
 catch (      IOException e) {
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void submitTraceEvent(final ChromeTraceEvent chromeTraceEvent){
  @SuppressWarnings("String_Node_Str") Future<?> unused=outputExecutor.submit(() -> {
    try {
      mapper.writeValue(jsonGenerator,chromeTraceEvent);
    }
 catch (    IOException e) {
    }
    return null;
  }
);
}