nus-yam/ex-repair huggingface dataset:
Program: 53123
Project: 53123
Buggy source:
public TargetNode<?> getTargetNode(final BuckEventBus eventBus,final Cell cell,final ProjectBuildFileParser parser,final BuildTarget target,final TargetNodeListener nodeListener) throws BuildFileParseException, InterruptedException {
  invalidateIfProjectBuildFileParserStateChanged(cell);
  try {
    return allTargetNodes.get(target,new Callable<TargetNode<?>>(){
      @Override public TargetNode<?> call() throws Exception {
        Path buildFile=cell.getAbsolutePathToBuildFile(target);
        Preconditions.checkState(buildFile.isAbsolute());
        List<Map<String,Object>> rawNodes=loadRawNodes(cell,buildFile,parser);
        for (        Map<String,Object> rawNode : rawNodes) {
          Object shortName=rawNode.get("String_Node_Str");
          if (target.getShortName().equals(shortName)) {
            return createTargetNode(eventBus,cell,buildFile,target,rawNode,nodeListener);
          }
        }
        throw new HumanReadableException(NoSuchBuildTargetException.createForMissingBuildRule(target,BuildTargetPatternParser.forBaseName(target.getBaseName()),cell.getBuildFileName(),"String_Node_Str" + buildFile));
      }
    }
);
  }
 catch (  UncheckedExecutionException|ExecutionException e) {
    throw propagate(e);
  }
}

Fixed version (ground truth):
public TargetNode<?> getTargetNode(final BuckEventBus eventBus,final Cell cell,final ProjectBuildFileParser parser,final BuildTarget target,final TargetNodeListener nodeListener) throws BuildFileParseException, BuildTargetException, InterruptedException {
  invalidateIfProjectBuildFileParserStateChanged(cell);
  try {
    return allTargetNodes.get(target,new Callable<TargetNode<?>>(){
      @Override public TargetNode<?> call() throws Exception {
        Path buildFile=cell.getAbsolutePathToBuildFile(target);
        Preconditions.checkState(buildFile.isAbsolute());
        List<Map<String,Object>> rawNodes=loadRawNodes(cell,buildFile,parser);
        for (        Map<String,Object> rawNode : rawNodes) {
          Object shortName=rawNode.get("String_Node_Str");
          if (target.getShortName().equals(shortName)) {
            return createTargetNode(eventBus,cell,buildFile,target,rawNode,nodeListener);
          }
        }
        throw new HumanReadableException(NoSuchBuildTargetException.createForMissingBuildRule(target,BuildTargetPatternParser.forBaseName(target.getBaseName()),cell.getBuildFileName(),"String_Node_Str" + buildFile));
      }
    }
);
  }
 catch (  UncheckedExecutionException|ExecutionException e) {
    Throwables.propagateIfInstanceOf(e.getCause(),BuildTargetException.class);
    throw propagate(e);
  }
}
Program: 53124
Project: 53124
Buggy source:
private RuntimeException propagate(Throwable e) throws BuildFileParseException, InterruptedException {
  Throwables.propagateIfInstanceOf(e.getCause(),BuildFileParseException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),BuildTargetParseException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),HumanReadableException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),InterruptedException.class);
  if (e instanceof ExecutionException | e instanceof UncheckedExecutionException) {
    Throwable cause=e.getCause();
    if (cause instanceof ExecutionException | cause instanceof UncheckedExecutionException) {
      throw propagate(cause);
    }
    if (cause instanceof BuildFileParseException) {
      throw (BuildFileParseException)cause;
    }
    if (cause != null) {
      Throwables.propagate(cause);
    }
  }
  return Throwables.propagate(e);
}

Fixed version (ground truth):
private RuntimeException propagate(Throwable e) throws BuildFileParseException, InterruptedException {
  Throwables.propagateIfInstanceOf(e.getCause(),BuildFileParseException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),BuildTargetParseException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),HumanReadableException.class);
  Throwables.propagateIfInstanceOf(e.getCause(),InterruptedException.class);
  if (e instanceof ExecutionException | e instanceof UncheckedExecutionException) {
    Throwable cause=e.getCause();
    if (cause instanceof ExecutionException | cause instanceof UncheckedExecutionException) {
      throw propagate(cause);
    }
    if (cause != null) {
      return Throwables.propagate(cause);
    }
  }
  return Throwables.propagate(e);
}
Program: 53126
Project: 53126
Buggy source:
public TargetGraph buildTargetGraph(final BuckEventBus eventBus,final Cell rootCell,final boolean enableProfiling,final Executor executor,final Iterable<BuildTarget> toExplore) throws IOException, InterruptedException, BuildFileParseException {
  ParserConfig config=new ParserConfig(rootCell.getBuckConfig());
  if (config.getEnableParallelParsing() && FluentIterable.from(toExplore).size() > 0) {
    return buildTargetGraphInParallel(eventBus,rootCell,enableProfiling,executor,toExplore);
  }
  return buildTargetGraphSerially(eventBus,rootCell,enableProfiling,toExplore);
}

Fixed version (ground truth):
public TargetGraph buildTargetGraph(final BuckEventBus eventBus,final Cell rootCell,final boolean enableProfiling,final Executor executor,final Iterable<BuildTarget> toExplore) throws IOException, InterruptedException, BuildFileParseException, BuildTargetException {
  ParserConfig config=new ParserConfig(rootCell.getBuckConfig());
  if (config.getEnableParallelParsing() && FluentIterable.from(toExplore).size() > 0) {
    return buildTargetGraphInParallel(eventBus,rootCell,enableProfiling,executor,toExplore);
  }
  return buildTargetGraphSerially(eventBus,rootCell,enableProfiling,toExplore);
}
Program: 53128
Project: 53128
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void xCellVisibilityShouldWorkAsExpected() throws IOException, InterruptedException, BuildFileParseException {
  try {
    parseTargetForXCellVisibility("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  HumanReadableException expected) {
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void xCellVisibilityShouldWorkAsExpected() throws IOException, InterruptedException, BuildFileParseException, BuildTargetException {
  try {
    parseTargetForXCellVisibility("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  HumanReadableException expected) {
  }
}
Program: 53129
Project: 53129
Buggy source:
@Test public void xCellSingleDirectoryVisibilityPatternsWork() throws InterruptedException, BuildFileParseException, IOException {
  parseTargetForXCellVisibility("String_Node_Str");
}

Fixed version (ground truth):
@Test public void xCellSingleDirectoryVisibilityPatternsWork() throws InterruptedException, BuildFileParseException, IOException, BuildTargetException {
  parseTargetForXCellVisibility("String_Node_Str");
}
Program: 53130
Project: 53130
Buggy source:
private void parseTargetForXCellVisibility(String targetName) throws IOException, InterruptedException, BuildFileParseException {
  Pair<ProjectWorkspace,ProjectWorkspace> cells=prepare("String_Node_Str","String_Node_Str");
  ProjectWorkspace primary=cells.getFirst();
  ProjectWorkspace secondary=cells.getSecond();
  registerCell(secondary,"String_Node_Str",primary);
  TypeCoercerFactory coercerFactory=new DefaultTypeCoercerFactory();
  Parser parser=new Parser(new ParserConfig(cells.getFirst().asCell().getBuckConfig()),coercerFactory,new ConstructorArgMarshaller(coercerFactory));
  BuckEventBus eventBus=BuckEventBusFactory.newInstance();
  Cell primaryCell=primary.asCell();
  BuildTarget namedTarget=BuildTargetFactory.newInstance(primaryCell.getFilesystem(),targetName);
  parser.buildTargetGraph(eventBus,primaryCell,false,Executors.newSingleThreadExecutor(),ImmutableSet.of(namedTarget));
}

Fixed version (ground truth):
private void parseTargetForXCellVisibility(String targetName) throws IOException, InterruptedException, BuildFileParseException, BuildTargetException {
  Pair<ProjectWorkspace,ProjectWorkspace> cells=prepare("String_Node_Str","String_Node_Str");
  ProjectWorkspace primary=cells.getFirst();
  ProjectWorkspace secondary=cells.getSecond();
  registerCell(secondary,"String_Node_Str",primary);
  TypeCoercerFactory coercerFactory=new DefaultTypeCoercerFactory();
  Parser parser=new Parser(new ParserConfig(cells.getFirst().asCell().getBuckConfig()),coercerFactory,new ConstructorArgMarshaller(coercerFactory));
  BuckEventBus eventBus=BuckEventBusFactory.newInstance();
  Cell primaryCell=primary.asCell();
  BuildTarget namedTarget=BuildTargetFactory.newInstance(primaryCell.getFilesystem(),targetName);
  parser.buildTargetGraph(eventBus,primaryCell,false,Executors.newSingleThreadExecutor(),ImmutableSet.of(namedTarget));
}
Program: 53131
Project: 53131
Buggy source:
@Test public void xCellSubDirectoryVisibilityPatternsWork() throws InterruptedException, BuildFileParseException, IOException {
  parseTargetForXCellVisibility("String_Node_Str");
}

Fixed version (ground truth):
@Test public void xCellSubDirectoryVisibilityPatternsWork() throws InterruptedException, BuildFileParseException, IOException, BuildTargetException {
  parseTargetForXCellVisibility("String_Node_Str");
}
Program: 53132
Project: 53132
Buggy source:
@Test public void xCellVisibilityPatternsBasedOnExplicitBuildTargetsWork() throws InterruptedException, BuildFileParseException, IOException {
  parseTargetForXCellVisibility("String_Node_Str");
}

Fixed version (ground truth):
@Test public void xCellVisibilityPatternsBasedOnExplicitBuildTargetsWork() throws InterruptedException, BuildFileParseException, IOException, BuildTargetException {
  parseTargetForXCellVisibility("String_Node_Str");
}
Program: 53133
Project: 53133
Buggy source:
@Test public void testMissingBuildRuleInValidFile() throws BuildFileParseException, BuildTargetException, IOException, InterruptedException {
  BuildTarget fooTarget=BuildTarget.builder(cellRoot,"String_Node_Str","String_Node_Str").build();
  BuildTarget razTarget=BuildTarget.builder(cellRoot,"String_Node_Str","String_Node_Str").build();
  Iterable<BuildTarget> buildTargets=ImmutableList.of(fooTarget,razTarget);
  thrown.expect(HumanReadableException.class);
  thrown.expectMessage("String_Node_Str" + "String_Node_Str");
  thrown.expectMessage("String_Node_Str" + filesystem.resolve(razTarget.getBasePath()).resolve(DEFAULT_BUILD_FILE_NAME));
  parser.buildTargetGraph(eventBus,cell,false,executorService,buildTargets);
}

Fixed version (ground truth):
@Test public void testMissingBuildRuleInValidFile() throws BuildFileParseException, BuildTargetException, IOException, InterruptedException {
  BuildTarget fooTarget=BuildTarget.builder(cellRoot,"String_Node_Str","String_Node_Str").build();
  BuildTarget razTarget=BuildTarget.builder(cellRoot,"String_Node_Str","String_Node_Str").build();
  Iterable<BuildTarget> buildTargets=ImmutableList.of(fooTarget,razTarget);
  thrown.expectMessage("String_Node_Str" + "String_Node_Str");
  thrown.expectMessage("String_Node_Str" + filesystem.resolve(razTarget.getBasePath()).resolve(DEFAULT_BUILD_FILE_NAME));
  parser.buildTargetGraph(eventBus,cell,false,executorService,buildTargets);
}
Program: 53134
Project: 53134
Buggy source:
@Test public void shouldThrowAnExceptionIfADepIsInAFileThatCannotBeParsed() throws IOException, InterruptedException, BuildTargetException, BuildFileParseException {
  thrown.expect(HumanReadableException.class);
  thrown.expectMessage("String_Node_Str");
  thrown.expectMessage("String_Node_Str");
  Path buckFile=cellRoot.resolve("String_Node_Str");
  Files.write(buckFile,"String_Node_Str".getBytes(UTF_8));
  buckFile=cellRoot.resolve("String_Node_Str");
  Files.createDirectories(buckFile.getParent());
  Files.write(buckFile,"String_Node_Str".getBytes(UTF_8));
  parser.buildTargetGraph(eventBus,cell,false,executorService,Collections.singleton(BuildTargetFactory.newInstance(cell.getFilesystem(),"String_Node_Str")));
}

Fixed version (ground truth):
@Test public void shouldThrowAnExceptionIfADepIsInAFileThatCannotBeParsed() throws IOException, InterruptedException, BuildTargetException, BuildFileParseException {
  thrown.expectMessage("String_Node_Str");
  thrown.expectMessage(Paths.get("String_Node_Str").toString());
  Path buckFile=cellRoot.resolve("String_Node_Str");
  Files.write(buckFile,"String_Node_Str".getBytes(UTF_8));
  buckFile=cellRoot.resolve("String_Node_Str");
  Files.createDirectories(buckFile.getParent());
  Files.write(buckFile,"String_Node_Str".getBytes(UTF_8));
  parser.buildTargetGraph(eventBus,cell,false,executorService,Collections.singleton(BuildTargetFactory.newInstance(cell.getFilesystem(),"String_Node_Str")));
}
Program: 53135
Project: 53135
Buggy source:
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attr) throws IOException {
  String filename=file.getFileName().toString();
  if (isResource(filename)) {
    paths.add(new PathSourcePath(filesystem,file));
  }
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attr) throws IOException {
  if (isResource(file)) {
    paths.add(new PathSourcePath(filesystem,file));
  }
  return FileVisitResult.CONTINUE;
}
Program: 53136
Project: 53136
Buggy source:
private boolean isResource(String fileOrDirName){
  if (NON_ASSET_FILENAMES.contains(fileOrDirName.toLowerCase())) {
    return false;
  }
  if (fileOrDirName.charAt(fileOrDirName.length() - 1) == '~') {
    return false;
  }
  if (MiniAapt.IGNORED_FILE_EXTENSIONS.contains(Files.getFileExtension(fileOrDirName))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean isResource(Path fileOrDir) throws IOException {
  for (  String nonAssetFilename : NON_ASSET_FILENAMES) {
    if (filesystem.isSameRelativePathIfFileExists(fileOrDir,fileOrDir.resolveSibling(nonAssetFilename))) {
      return false;
    }
  }
  String fileOrDirName=fileOrDir.getFileName().toString();
  if (fileOrDirName.charAt(fileOrDirName.length() - 1) == '~') {
    return false;
  }
  String fileOrDirNameWithoutExtension=Files.getNameWithoutExtension(fileOrDirName);
  for (  String ignoredMiniAaptExtension : MiniAapt.IGNORED_FILE_EXTENSIONS) {
    if (filesystem.isSameRelativePathIfFileExists(fileOrDir,fileOrDir.resolveSibling(fileOrDirNameWithoutExtension + "String_Node_Str" + ignoredMiniAaptExtension))) {
      return false;
    }
  }
  return true;
}
Program: 53138
Project: 53138
Buggy source:
@Override public FileVisitResult preVisitDirectory(Path dir,BasicFileAttributes attr) throws IOException {
  String dirName=dir.getFileName().toString();
  if (dirName.charAt(0) == '_' || !isResource(dirName)) {
    return FileVisitResult.SKIP_SUBTREE;
  }
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult preVisitDirectory(Path dir,BasicFileAttributes attr) throws IOException {
  if (dir.getFileName().toString().charAt(0) == '_' || !isResource(dir)) {
    return FileVisitResult.SKIP_SUBTREE;
  }
  return FileVisitResult.CONTINUE;
}
Program: 53140
Project: 53140
Buggy source:
@Override public NativeLinkableInput getNativeLinkableInput(CxxPlatform cxxPlatform,Linker.LinkableDepType type){
  HalideLibrary rule=(HalideLibrary)requireBuildRule(cxxPlatform);
  Path libPath=getPathToOutput().resolve(rule.getLibraryName());
  return NativeLinkableInput.of(SourcePathArg.from(getResolver(),new BuildTargetSourcePath(rule.getBuildTarget(),libPath)),ImmutableSet.<FrameworkPath>of(),ImmutableSet.<FrameworkPath>of());
}

Fixed version (ground truth):
@Override public NativeLinkableInput getNativeLinkableInput(CxxPlatform cxxPlatform,Linker.LinkableDepType type){
  HalideLibrary rule=(HalideLibrary)requireBuildRule(cxxPlatform);
  Path libPath=rule.getPathToOutput().resolve(rule.getLibraryName());
  return NativeLinkableInput.of(SourcePathArg.from(getResolver(),new BuildTargetSourcePath(rule.getBuildTarget(),libPath)),ImmutableSet.<FrameworkPath>of(),ImmutableSet.<FrameworkPath>of());
}
Program: 53141
Project: 53141
Buggy source:
/** 
 * Modified version of <a href="http://fburl.com/8840769">Device.uninstallPackage()</a>.
 * @param device an {@link IDevice}
 * @param packageName application package name
 * @param keepData  true if user data is to be kept
 * @return error message or null if successful
 * @throws InstallException
 */
@Nullable private String deviceUninstallPackage(IDevice device,String packageName,boolean keepData) throws InstallException {
  try {
    AdbHelper.ErrorParsingReceiver receiver=new AdbHelper.ErrorParsingReceiver(){
      @Override @Nullable protected String matchForError(      String line){
        return line.toLowerCase().contains("String_Node_Str") ? line : null;
      }
    }
;
    device.executeShellCommand("String_Node_Str" + (keepData ? "String_Node_Str" : "String_Node_Str") + packageName,receiver,AdbHelper.INSTALL_TIMEOUT,TimeUnit.MILLISECONDS);
    return receiver.getErrorMessage();
  }
 catch (  AdbCommandRejectedException|IOException|ShellCommandUnresponsiveException|TimeoutException e) {
    throw new InstallException(e);
  }
}

Fixed version (ground truth):
/** 
 * Modified version of <a href="http://fburl.com/8840769">Device.uninstallPackage()</a>.
 * @param device an {@link IDevice}
 * @param packageName application package name
 * @param keepData  true if user data is to be kept
 * @return error message or null if successful
 * @throws InstallException
 */
@Nullable private String deviceUninstallPackage(IDevice device,String packageName,boolean keepData) throws InstallException {
  try {
    AdbHelper.ErrorParsingReceiver receiver=new AdbHelper.ErrorParsingReceiver(){
      @Override @Nullable protected String matchForError(      String line){
        return line.toLowerCase(Locale.US).contains("String_Node_Str") ? line : null;
      }
    }
;
    device.executeShellCommand("String_Node_Str" + (keepData ? "String_Node_Str" : "String_Node_Str") + packageName,receiver,AdbHelper.INSTALL_TIMEOUT,TimeUnit.MILLISECONDS);
    return receiver.getErrorMessage();
  }
 catch (  AdbCommandRejectedException|IOException|ShellCommandUnresponsiveException|TimeoutException e) {
    throw new InstallException(e);
  }
}
Program: 53143
Project: 53143
Buggy source:
@Override @Nullable protected String matchForError(String line){
  return line.toLowerCase().contains("String_Node_Str") ? line : null;
}

Fixed version (ground truth):
@Override @Nullable protected String matchForError(String line){
  return line.toLowerCase(Locale.US).contains("String_Node_Str") ? line : null;
}
Program: 53145
Project: 53145
Buggy source:
@Test public void testHalideLibraryRule() throws IOException {
  BuildTarget compilerTarget=BuildTarget.builder(rootPath,"String_Node_Str","String_Node_Str").addFlavors(HalideLibraryDescription.HALIDE_COMPILER_FLAVOR).build();
  TargetNode<?> compiler=new HalideLibraryBuilder(compilerTarget).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(new TestSourcePath("String_Node_Str")),SourceWithFlags.of(new TestSourcePath("String_Node_Str")))).build();
  BuildTarget libTarget=BuildTarget.builder(rootPath,"String_Node_Str","String_Node_Str").build();
  TargetNode<?> lib=new HalideLibraryBuilder(libTarget).build();
  ProjectGenerator projectGenerator=createProjectGeneratorForCombinedProject(ImmutableSet.<TargetNode<?>>of(compiler,lib));
  projectGenerator.createXcodeProjects();
  PBXTarget target=assertTargetExistsAndReturnTarget(projectGenerator.getGeneratedProject(),"String_Node_Str");
  assertThat(target.isa(),equalTo("String_Node_Str"));
  assertHasConfigurations(target,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(1,target.getBuildPhases().size());
  PBXShellScriptBuildPhase scriptPhase=getSingletonPhaseByType(target,PBXShellScriptBuildPhase.class);
  assertEquals(0,scriptPhase.getInputPaths().size());
  assertEquals(0,scriptPhase.getOutputPaths().size());
}

Fixed version (ground truth):
@Test public void testHalideLibraryRule() throws IOException {
  BuildTarget compilerTarget=BuildTarget.builder(rootPath,"String_Node_Str","String_Node_Str").addFlavors(HalideLibraryDescription.HALIDE_COMPILER_FLAVOR).build();
  TargetNode<?> compiler=new HalideLibraryBuilder(compilerTarget).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(new TestSourcePath("String_Node_Str")),SourceWithFlags.of(new TestSourcePath("String_Node_Str")))).build();
  BuildTarget libTarget=BuildTarget.builder(rootPath,"String_Node_Str","String_Node_Str").build();
  TargetNode<?> lib=new HalideLibraryBuilder(libTarget).build();
  ProjectGenerator projectGenerator=createProjectGeneratorForCombinedProject(ImmutableSet.<TargetNode<?>>of(compiler,lib));
  projectGenerator.createXcodeProjects();
  PBXTarget target=assertTargetExistsAndReturnTarget(projectGenerator.getGeneratedProject(),"String_Node_Str");
  assertThat(target.isa(),equalTo("String_Node_Str"));
  assertHasConfigurations(target,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(1,target.getBuildPhases().size());
  PBXShellScriptBuildPhase scriptPhase=getSingletonPhaseByType(target,PBXShellScriptBuildPhase.class);
  assertEquals(0,scriptPhase.getInputPaths().size());
  assertEquals(0,scriptPhase.getOutputPaths().size());
  ImmutableSet<BuildTarget> requiredBuildTargets=projectGenerator.getRequiredBuildTargets();
  assertTrue(requiredBuildTargets.contains(compilerTarget));
  assertTrue(requiredBuildTargets.contains(libTarget));
}
Program: 53146
Project: 53146
Buggy source:
private ImmutableSet<Path> collectRecursiveHalideLibraryHeaderPaths(TargetNode<? extends CxxLibraryDescription.Arg> targetNode){
  ImmutableSet.Builder<Path> builder=ImmutableSet.builder();
  for (  TargetNode<?> input : AppleBuildRules.getRecursiveTargetNodeDependenciesOfTypes(targetGraph,AppleBuildRules.RecursiveDependenciesMode.BUILDING,targetNode,Optional.of(ImmutableSet.<BuildRuleType>of(HalideLibraryDescription.TYPE)))) {
    BuildTarget buildTarget=input.getBuildTarget();
    if (!HalideLibraryDescription.isHalideCompilerTarget(buildTarget)) {
      Path outputDir=getHalideOutputPath(buildTarget);
      builder.add(pathRelativizer.outputDirToRootRelative(outputDir));
    }
  }
  return builder.build();
}

Fixed version (ground truth):
private ImmutableSet<Path> collectRecursiveHalideLibraryHeaderPaths(TargetNode<? extends CxxLibraryDescription.Arg> targetNode){
  ImmutableSet.Builder<Path> builder=ImmutableSet.builder();
  for (  TargetNode<?> input : AppleBuildRules.getRecursiveTargetNodeDependenciesOfTypes(targetGraph,AppleBuildRules.RecursiveDependenciesMode.BUILDING,targetNode,Optional.of(ImmutableSet.<BuildRuleType>of(HalideLibraryDescription.TYPE)))) {
    BuildTarget buildTarget=input.getBuildTarget();
    if (!HalideLibraryDescription.isHalideCompilerTarget(buildTarget)) {
      builder.add(pathRelativizer.outputDirToRootRelative(BuildTargets.getGenPath(BuildTarget.of(buildTarget.getUnflavoredBuildTarget()),"String_Node_Str")));
    }
  }
  return builder.build();
}
Program: 53149
Project: 53149
Buggy source:
@Override public boolean equals(Object obj){
  return (obj instanceof TestDescription) && this.hashCode() == obj.hashCode();
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (!(obj instanceof TestDescription)) {
    return false;
  }
  TestDescription other=(TestDescription)obj;
  return Objects.equals(this.className,other.className) && Objects.equals(this.methodName,other.methodName);
}
Program: 53151
Project: 53151
Buggy source:
@Override public VersionControlCmdLineInterface createCmdLineInterface() throws InterruptedException {
  HgCmdLineInterface hgCmdLineInterface=new HgCmdLineInterface(processExecutor,projectRoot.toFile(),hgCmd);
  try {
    hgCmdLineInterface.currentRevisionId();
    LOG.debug("String_Node_Str");
    return hgCmdLineInterface;
  }
 catch (  VersionControlCommandFailedException ex) {
    LOG.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",ex);
  }
  LOG.debug("String_Node_Str");
  return new NoOpCmdLineInterface();
}

Fixed version (ground truth):
@Override public VersionControlCmdLineInterface createCmdLineInterface() throws InterruptedException {
  HgCmdLineInterface hgCmdLineInterface=new HgCmdLineInterface(processExecutorFactory,projectRoot.toFile(),hgCmd);
  try {
    hgCmdLineInterface.currentRevisionId();
    LOG.debug("String_Node_Str");
    return hgCmdLineInterface;
  }
 catch (  VersionControlCommandFailedException ex) {
    LOG.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",ex);
  }
  LOG.debug("String_Node_Str");
  return new NoOpCmdLineInterface();
}
Program: 53152
Project: 53152
Buggy source:
public DefaultVersionControlCmdLineInterfaceFactory(Path projectRoot,ProcessExecutor processExecutor,VersionControlBuckConfig buckConfig){
  this.projectRoot=projectRoot;
  this.processExecutor=processExecutor;
  this.hgCmd=buckConfig.getHgCmd();
}

Fixed version (ground truth):
public DefaultVersionControlCmdLineInterfaceFactory(Path projectRoot,ProcessExecutorFactory processExecutorFactory,VersionControlBuckConfig buckConfig){
  this.projectRoot=projectRoot;
  this.processExecutorFactory=processExecutorFactory;
  this.hgCmd=buckConfig.getHgCmd();
}
Program: 53153
Project: 53153
Buggy source:
private String executeCommand(Iterable<String> command) throws VersionControlCommandFailedException, InterruptedException {
  command=replaceTemplateValue(command,HG_CMD_TEMPLATE,hgCmd);
  ProcessExecutorParams processExecutorParams=ProcessExecutorParams.builder().setCommand(command).setDirectory(projectRoot).build();
  String commandString=commandAsString(command);
  LOG.debug("String_Node_Str" + commandString);
  try {
    ProcessExecutor.Result result=processExecutor.launchAndExecute(processExecutorParams,ImmutableSet.of(ProcessExecutor.Option.EXPECTING_STD_OUT),Optional.<String>absent(),Optional.<Long>absent(),Optional.<Function<Process,Void>>absent());
    Optional<String> resultString=result.getStdout();
    if (!resultString.isPresent()) {
      throw new VersionControlCommandFailedException("String_Node_Str" + commandString);
    }
    if (result.getExitCode() != 0) {
      throw new VersionControlCommandFailedException("String_Node_Str" + commandString);
    }
    return cleanResultString(resultString.get());
  }
 catch (  IOException e) {
    throw new VersionControlCommandFailedException(e);
  }
}

Fixed version (ground truth):
private String executeCommand(Iterable<String> command) throws VersionControlCommandFailedException, InterruptedException {
  command=replaceTemplateValue(command,HG_CMD_TEMPLATE,hgCmd);
  String commandString=commandAsString(command);
  LOG.debug("String_Node_Str" + commandString);
  ProcessExecutorParams processExecutorParams=ProcessExecutorParams.builder().setCommand(command).setDirectory(projectRoot).build();
  ProcessExecutor.Result result;
  try (PrintStream stdout=new PrintStream(new ByteArrayOutputStream());PrintStream stderr=new PrintStream(new ByteArrayOutputStream())){
    ProcessExecutor processExecutor=processExecutorFactory.createProcessExecutor(stdout,stderr);
    result=processExecutor.launchAndExecute(processExecutorParams);
  }
 catch (  IOException e) {
    throw new VersionControlCommandFailedException(e);
  }
  Optional<String> resultString=result.getStdout();
  if (!resultString.isPresent()) {
    throw new VersionControlCommandFailedException("String_Node_Str" + commandString);
  }
  if (result.getExitCode() != 0) {
    Optional<String> stderr=result.getStderr();
    String stdErrString=stderr.isPresent() ? stderr.get() : "String_Node_Str";
    throw new VersionControlCommandFailedException("String_Node_Str" + commandString + "String_Node_Str"+ stdErrString);
  }
  return cleanResultString(resultString.get());
}
Program: 53154
Project: 53154
Buggy source:
public HgCmdLineInterface(ProcessExecutor processExecutor,File projectRoot,String hgCmd){
  this.processExecutor=processExecutor;
  this.projectRoot=projectRoot;
  this.hgCmd=hgCmd;
}

Fixed version (ground truth):
public HgCmdLineInterface(ProcessExecutorFactory processExecutorFactory,File projectRoot,String hgCmd){
  this.processExecutorFactory=processExecutorFactory;
  this.projectRoot=projectRoot;
  this.hgCmd=hgCmd;
}
Program: 53157
Project: 53157
Buggy source:
@Test public void testAppleBinaryBuildsSomething() throws IOException {
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckCommand("String_Node_Str","String_Node_Str").assertSuccess();
  assertTrue(Files.exists(tmp.getRootPath().resolve(BuckConstant.GEN_DIR)));
}

Fixed version (ground truth):
@Test public void testAppleBinaryBuildsSomething() throws IOException {
  assumeTrue(Platform.detect() == Platform.MACOS);
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckCommand("String_Node_Str","String_Node_Str").assertSuccess();
  assertTrue(Files.exists(tmp.getRootPath().resolve(BuckConstant.GEN_DIR)));
}
Program: 53158
Project: 53158
Buggy source:
@Test public void bundleBinaryHasDsymBundle() throws IOException, InterruptedException {
  assumeTrue(Platform.detect() == Platform.MACOS);
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckCommand("String_Node_Str","String_Node_Str").assertSuccess();
  workspace.verify();
  Path bundlePath=tmp.getRootPath().resolve(BuckConstant.GEN_DIR).resolve("String_Node_Str");
  Path dwarfPath=bundlePath.getParent().resolve("String_Node_Str");
  Path binaryPath=bundlePath.resolve("String_Node_Str");
  assertTrue(Files.exists(dwarfPath));
  String dwarfdumpMainStdout=workspace.runCommand("String_Node_Str","String_Node_Str","String_Node_Str",dwarfPath.toString()).getStdout().or("String_Node_Str");
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  ProcessExecutor.Result result=workspace.runCommand("String_Node_Str","String_Node_Str",binaryPath.toString() + "String_Node_Str",binaryPath.toString());
  assertThat(result.getStdout().isPresent(),is(true));
  assertThat(result.getStdout().get(),containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void bundleBinaryHasDsymBundle() throws IOException, InterruptedException {
  assumeTrue(Platform.detect() == Platform.MACOS);
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckCommand("String_Node_Str","String_Node_Str").assertSuccess();
  workspace.verify();
  Path bundlePath=tmp.getRootPath().resolve(BuckConstant.GEN_DIR).resolve("String_Node_Str");
  Path dwarfPath=bundlePath.getParent().resolve("String_Node_Str");
  Path binaryPath=bundlePath.resolve("String_Node_Str");
  assertTrue(Files.exists(dwarfPath));
  String dwarfdumpMainStdout=workspace.runCommand("String_Node_Str","String_Node_Str","String_Node_Str",dwarfPath.toString()).getStdout().or("String_Node_Str");
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  assertTrue(dwarfdumpMainStdout.contains("String_Node_Str"));
  ProcessExecutor.Result result=workspace.runCommand("String_Node_Str","String_Node_Str",binaryPath.toString() + "String_Node_Str",binaryPath.toString());
  String dsymutilOutput="String_Node_Str";
  if (result.getStderr().isPresent()) {
    dsymutilOutput=result.getStderr().get();
  }
  if (dsymutilOutput.isEmpty()) {
    assertThat(result.getStdout().isPresent(),is(true));
    dsymutilOutput=result.getStdout().get();
  }
  assertThat(dsymutilOutput,containsString("String_Node_Str"));
}
Program: 53160
Project: 53160
Buggy source:
public static Path getHeaderPathPrefix(AppleNativeTargetDescriptionArg arg,BuildTarget buildTarget){
  return Paths.get(arg.headerPathPrefix.or(buildTarget.getShortName()));
}

Fixed version (ground truth):
public static Path getHeaderPathPrefix(CxxLibraryDescription.Arg arg,BuildTarget buildTarget){
  Optional<String> prefix;
  if (arg instanceof AppleNativeTargetDescriptionArg) {
    prefix=((AppleNativeTargetDescriptionArg)arg).headerPathPrefix;
  }
 else {
    prefix=arg.headerNamespace;
  }
  return Paths.get(prefix.or(buildTarget.getShortName()));
}
Program: 53162
Project: 53162
Buggy source:
@Override public Optional<Function<String,Iterable<String>>> getExtraLineProcessor(){
  return Optional.<Function<String,Iterable<String>>>of(new Function<String,Iterable<String>>(){
    @Override public Iterable<String> apply(    String input){
      String remainder=input;
      ImmutableList.Builder<String> processedLines=ImmutableList.builder();
      while (!remainder.isEmpty()) {
        Matcher m=PRAGMA_TOKEN_PLACEHOLDER_PATTERN.matcher(remainder);
        if (!m.matches()) {
          processedLines.add(remainder);
          break;
        }
        processedLines.add(m.group(1));
        processedLines.add("String_Node_Str" + m.group(2).replaceAll("String_Node_Str","String_Node_Str"));
        remainder=m.group(3);
      }
      return processedLines.build();
    }
  }
);
}

Fixed version (ground truth):
@Override public Optional<Function<String,Iterable<String>>> getExtraLineProcessor(){
  return Optional.<Function<String,Iterable<String>>>of(new Function<String,Iterable<String>>(){
    @Override public Iterable<String> apply(    String input){
      String remainder=input;
      ImmutableList.Builder<String> processedLines=ImmutableList.builder();
      if (remainder.isEmpty()) {
        processedLines.add(remainder);
      }
      while (!remainder.isEmpty()) {
        Matcher m=PRAGMA_TOKEN_PLACEHOLDER_PATTERN.matcher(remainder);
        if (!m.matches()) {
          processedLines.add(remainder);
          break;
        }
        processedLines.add(m.group(1));
        processedLines.add("String_Node_Str" + m.group(2).replaceAll("String_Node_Str","String_Node_Str"));
        remainder=m.group(3);
      }
      return processedLines.build();
    }
  }
);
}
Program: 53163
Project: 53163
Buggy source:
@Override public Iterable<String> apply(String input){
  String remainder=input;
  ImmutableList.Builder<String> processedLines=ImmutableList.builder();
  while (!remainder.isEmpty()) {
    Matcher m=PRAGMA_TOKEN_PLACEHOLDER_PATTERN.matcher(remainder);
    if (!m.matches()) {
      processedLines.add(remainder);
      break;
    }
    processedLines.add(m.group(1));
    processedLines.add("String_Node_Str" + m.group(2).replaceAll("String_Node_Str","String_Node_Str"));
    remainder=m.group(3);
  }
  return processedLines.build();
}

Fixed version (ground truth):
@Override public Iterable<String> apply(String input){
  String remainder=input;
  ImmutableList.Builder<String> processedLines=ImmutableList.builder();
  if (remainder.isEmpty()) {
    processedLines.add(remainder);
  }
  while (!remainder.isEmpty()) {
    Matcher m=PRAGMA_TOKEN_PLACEHOLDER_PATTERN.matcher(remainder);
    if (!m.matches()) {
      processedLines.add(remainder);
      break;
    }
    processedLines.add(m.group(1));
    processedLines.add("String_Node_Str" + m.group(2).replaceAll("String_Node_Str","String_Node_Str"));
    remainder=m.group(3);
  }
  return processedLines.build();
}
Program: 53164
Project: 53164
Buggy source:
/** 
 * Evaluate multiple queries in a single `buck query` run. Usage: buck query <query format> <input1> <input2> <...> <inputN>
 */
static int runMultipleQuery(CommandRunnerParams params,BuckQueryEnvironment env,String queryFormat,List<String> inputsFormattedAsBuildTargets,boolean generateJsonOutput) throws IOException, InterruptedException {
  if (inputsFormattedAsBuildTargets.isEmpty()) {
    params.getConsole().printBuildFailure("String_Node_Str");
    return 1;
  }
  try {
    TreeMultimap<BuildTarget,BuildTarget> queryResultMap=TreeMultimap.create();
    for (    String input : inputsFormattedAsBuildTargets) {
      BuildTarget target=BuildTargetParser.INSTANCE.parse(input,BuildTargetPatternParser.fullyQualified());
      String query=queryFormat.replace("String_Node_Str",input);
      Set<BuildTarget> queryResult=env.evaluateQuery(query);
      queryResultMap.putAll(target,queryResult);
    }
    LOG.debug("String_Node_Str" + queryResultMap);
    if (generateJsonOutput) {
      CommandHelper.printJSON(params,queryResultMap);
    }
 else {
      CommandHelper.printToConsole(params,queryResultMap);
    }
  }
 catch (  QueryException e) {
    if (e.getCause() instanceof InterruptedException) {
      throw (InterruptedException)e.getCause();
    }
    params.getConsole().printBuildFailureWithoutStacktrace(e);
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Evaluate multiple queries in a single `buck query` run. Usage: buck query <query format> <input1> <input2> <...> <inputN>
 */
static int runMultipleQuery(CommandRunnerParams params,BuckQueryEnvironment env,String queryFormat,List<String> inputsFormattedAsBuildTargets,boolean generateJsonOutput) throws IOException, InterruptedException {
  if (inputsFormattedAsBuildTargets.isEmpty()) {
    params.getConsole().printBuildFailure("String_Node_Str");
    return 1;
  }
  try {
    TreeMultimap<String,BuildTarget> queryResultMap=TreeMultimap.create();
    for (    String input : inputsFormattedAsBuildTargets) {
      String query=queryFormat.replace("String_Node_Str",input);
      Set<BuildTarget> queryResult=env.evaluateQuery(query);
      queryResultMap.putAll(input,queryResult);
    }
    LOG.debug("String_Node_Str" + queryResultMap);
    if (generateJsonOutput) {
      CommandHelper.printJSON(params,queryResultMap);
    }
 else {
      CommandHelper.printToConsole(params,queryResultMap);
    }
  }
 catch (  QueryException e) {
    if (e.getCause() instanceof InterruptedException) {
      throw (InterruptedException)e.getCause();
    }
    params.getConsole().printBuildFailureWithoutStacktrace(e);
    return 1;
  }
  return 0;
}
Program: 53165
Project: 53165
Buggy source:
@Override public int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  if (arguments.isEmpty()) {
    params.getConsole().printBuildFailure("String_Node_Str");
    return 1;
  }
  Set<QueryEnvironment.Setting> settings=new HashSet<>();
  BuckQueryEnvironment env=new BuckQueryEnvironment(params,settings,getEnableProfiling());
  String queryFormat=arguments.remove(0);
  if (queryFormat.contains("String_Node_Str")) {
    return runMultipleQuery(params,env,queryFormat,getArgumentsFormattedAsBuildTargets(params.getBuckConfig()),shouldGenerateJsonOutput());
  }
 else {
    return runSingleQuery(params,env,queryFormat);
  }
}

Fixed version (ground truth):
@Override public int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  if (arguments.isEmpty()) {
    params.getConsole().printBuildFailure("String_Node_Str");
    return 1;
  }
  Set<QueryEnvironment.Setting> settings=new HashSet<>();
  BuckQueryEnvironment env=new BuckQueryEnvironment(params,settings,getEnableProfiling());
  String queryFormat=arguments.remove(0);
  if (queryFormat.contains("String_Node_Str")) {
    return runMultipleQuery(params,env,queryFormat,arguments,shouldGenerateJsonOutput());
  }
 else {
    return runSingleQuery(params,env,queryFormat);
  }
}
Program: 53167
Project: 53167
Buggy source:
@Subscribe public void incrementNumRulesCompleted(@SuppressWarnings("String_Node_Str") BuildRuleEvent.Finished finished){
  numRulesCompleted.getAndIncrement();
}

Fixed version (ground truth):
@Subscribe public void incrementNumRulesCompleted(BuildRuleEvent.Finished finished){
  if (finished.getStatus() != BuildRuleStatus.CANCELED) {
    numRulesCompleted.getAndIncrement();
  }
}
Program: 53168
Project: 53168
Buggy source:
@Subscribe public void buildRuleFinished(BuildRuleEvent.Finished finished){
  String line=String.format("String_Node_Str",finished.getBuildRule().getFullyQualifiedName());
  if (ruleCount.isPresent()) {
    line+=String.format("String_Node_Str",numRulesCompleted.get(),ruleCount.get());
  }
  console.getStdErr().println(line);
}

Fixed version (ground truth):
@Subscribe public void buildRuleFinished(BuildRuleEvent.Finished finished){
  if (finished.getStatus() == BuildRuleStatus.SUCCESS) {
    String line=String.format("String_Node_Str",finished.getBuildRule().getFullyQualifiedName());
    if (ruleCount.isPresent()) {
      line+=String.format("String_Node_Str",numRulesCompleted.get(),ruleCount.get());
    }
    console.getStdErr().println(line);
  }
}
Program: 53169
Project: 53169
Buggy source:
@Subscribe public void buildRuleFinished(BuildRuleEvent.Finished finished){
  threadsToRunningBuildRuleEvent.put(finished.getThreadId(),Optional.<BuildRuleEvent>absent());
  accumulatedRuleTime.remove(finished.getBuildRule().getBuildTarget());
  CacheResult cacheResult=finished.getCacheResult();
  if (cacheResult.getType() != CacheResult.Type.LOCAL_KEY_UNCHANGED_HIT) {
    updated.incrementAndGet();
    if (cacheResult.getType() == CacheResult.Type.HIT) {
      cacheHits.incrementAndGet();
    }
 else     if (cacheResult.getType() == CacheResult.Type.ERROR) {
      cacheErrors.incrementAndGet();
    }
  }
}

Fixed version (ground truth):
@Subscribe public void buildRuleFinished(BuildRuleEvent.Finished finished){
  threadsToRunningBuildRuleEvent.put(finished.getThreadId(),Optional.<BuildRuleEvent>absent());
  accumulatedRuleTime.remove(finished.getBuildRule().getBuildTarget());
  if (finished.getStatus() == BuildRuleStatus.SUCCESS) {
    CacheResult cacheResult=finished.getCacheResult();
    if (cacheResult.getType() != CacheResult.Type.LOCAL_KEY_UNCHANGED_HIT) {
      updated.incrementAndGet();
      if (cacheResult.getType() == CacheResult.Type.HIT) {
        cacheHits.incrementAndGet();
      }
 else       if (cacheResult.getType() == CacheResult.Type.ERROR) {
        cacheErrors.incrementAndGet();
      }
    }
  }
}
Program: 53170
Project: 53170
Buggy source:
/** 
 * Note: This should only be used inside   {@link CachingBuildEngine} and unit tests.
 */
public BuildResult(BuildRule rule,Throwable failure){
  this.rule=rule;
  this.status=BuildRuleStatus.FAIL;
  this.cacheResult=CacheResult.miss();
  this.success=null;
  this.failure=failure;
}

Fixed version (ground truth):
private BuildResult(BuildRule rule,BuildRuleStatus status,CacheResult cacheResult,@Nullable BuildRuleSuccessType success,@Nullable Throwable failure){
  this.rule=rule;
  this.status=status;
  this.cacheResult=cacheResult;
  this.success=success;
  this.failure=failure;
}
Program: 53171
Project: 53171
Buggy source:
@Nullable Throwable getFailure(){
  return failure;
}

Fixed version (ground truth):
@Nullable public Throwable getFailure(){
  return failure;
}
Program: 53172
Project: 53172
Buggy source:
@Override protected ImmutableList<String> getShellCommandInternal(ExecutionContext context){
  ImmutableList.Builder<String> commandBuilder=ImmutableList.builder();
  commandBuilder.addAll(command);
  commandBuilder.add("String_Node_Str" + context.getProjectFilesystem().getRootPath().toString() + "String_Node_Str","String_Node_Str",context.getProjectFilesystem().resolve(output).toString(),context.getProjectFilesystem().resolve(input).toString());
  return commandBuilder.build();
}

Fixed version (ground truth):
@Override protected ImmutableList<String> getShellCommandInternal(ExecutionContext context){
  ImmutableList.Builder<String> commandBuilder=ImmutableList.builder();
  commandBuilder.addAll(command);
  commandBuilder.add("String_Node_Str",context.getProjectFilesystem().resolve(output).toString(),context.getProjectFilesystem().resolve(input).toString());
  return commandBuilder.build();
}
Program: 53174
Project: 53174
Buggy source:
/** 
 * Finds the build file responsible for the given   {@link Path} and invalidatesall of the cached rules dependent on it.
 * @param path A {@link Path}, relative to the project root and "contained" within the build file to find and invalidate.
 */
private synchronized void invalidateContainingBuildFile(Path path) throws IOException {
  Optional<Path> packageBuildFile=buildFileTreeCache.get().getBasePathOfAncestorTarget(path);
  if (!packageBuildFile.isPresent()) {
    return;
  }
  state.invalidateDependents(repository.getFilesystem().getPathForRelativePath(packageBuildFile.get().resolve(new ParserConfig(repository.getBuckConfig()).getBuildFileName())));
}

Fixed version (ground truth):
/** 
 * Finds the build file responsible for the given   {@link Path} and invalidatesall of the cached rules dependent on it.
 * @param path A {@link Path}, relative to the project root and "contained" within the build file to find and invalidate.
 */
private synchronized void invalidateContainingBuildFile(Path path) throws IOException {
  List<Path> packageBuildFiles=Lists.newArrayList();
  Optional<Path> packageBuildFile=buildFileTreeCache.get().getBasePathOfAncestorTarget(path);
  packageBuildFiles.addAll(packageBuildFile.asSet());
  if (!enforceBuckPackageBoundary) {
    while (packageBuildFile.isPresent() && packageBuildFile.get().getParent() != null) {
      packageBuildFile=buildFileTreeCache.get().getBasePathOfAncestorTarget(packageBuildFile.get().getParent());
      packageBuildFiles.addAll(packageBuildFile.asSet());
    }
  }
  for (  Path buildFile : packageBuildFiles) {
    state.invalidateDependents(repository.getFilesystem().getPathForRelativePath(buildFile.resolve(new ParserConfig(repository.getBuckConfig()).getBuildFileName())));
  }
}
Program: 53175
Project: 53175
Buggy source:
@Override public Optional<Linker.LinkableDepType> getPreferredLinkage(CxxPlatform cxxPlatform){
  if (linkage == Linkage.STATIC) {
    return Optional.of(Linker.LinkableDepType.STATIC);
  }
  return Optional.absent();
}

Fixed version (ground truth):
@Override public NativeLinkable.Linkage getPreferredLinkage(CxxPlatform cxxPlatform){
  return linkage;
}
Program: 53176
Project: 53176
Buggy source:
Optional<Linker.LinkableDepType> getPreferredLinkage(CxxPlatform cxxPlatform);

Fixed version (ground truth):
Linkage getPreferredLinkage(CxxPlatform cxxPlatform);
Program: 53177
Project: 53177
Buggy source:
private static NativeLinkableNode processBuildRule(CxxPlatform cxxPlatform,Map<BuildTarget,Linker.LinkableDepType> wanted,BuildRule rule,Linker.LinkableDepType type,NativeLinkableNode.Pass pass){
  if (!(rule instanceof NativeLinkable)) {
    return NativeLinkableNode.of(rule,pass);
  }
  NativeLinkable linkable=(NativeLinkable)rule;
  Linker.LinkableDepType depType=linkable.getPreferredLinkage(cxxPlatform).or(type);
  if (pass == AbstractNativeLinkableNode.Pass.ANY || depType == Linker.LinkableDepType.SHARED) {
    Linker.LinkableDepType oldType=wanted.put(rule.getBuildTarget(),depType);
    Preconditions.checkState(oldType == null || oldType == depType);
  }
  if (depType == Linker.LinkableDepType.SHARED) {
    pass=AbstractNativeLinkableNode.Pass.SHARED_ONLY;
  }
  return NativeLinkableNode.of(rule,pass);
}

Fixed version (ground truth):
private static NativeLinkableNode processBuildRule(CxxPlatform cxxPlatform,Map<BuildTarget,Linker.LinkableDepType> wanted,BuildRule rule,Linker.LinkableDepType type,NativeLinkableNode.Pass pass){
  if (!(rule instanceof NativeLinkable)) {
    return NativeLinkableNode.of(rule,pass);
  }
  NativeLinkable linkable=(NativeLinkable)rule;
  NativeLinkable.Linkage depLinkage=linkable.getPreferredLinkage(cxxPlatform);
  Linker.LinkableDepType depType;
switch (depLinkage) {
case STATIC:
{
      depType=type == Linker.LinkableDepType.STATIC ? Linker.LinkableDepType.STATIC : Linker.LinkableDepType.STATIC_PIC;
      break;
    }
case ANY:
{
    depType=type;
    break;
  }
default :
{
  throw new IllegalStateException();
}
}
if (pass == AbstractNativeLinkableNode.Pass.ANY || depType == Linker.LinkableDepType.SHARED) {
Linker.LinkableDepType oldType=wanted.put(rule.getBuildTarget(),depType);
Preconditions.checkState(oldType == null || oldType == depType);
}
if (depType == Linker.LinkableDepType.SHARED) {
pass=AbstractNativeLinkableNode.Pass.SHARED_ONLY;
}
return NativeLinkableNode.of(rule,pass);
}
Program: 53178
Project: 53178
Buggy source:
@Override public Optional<Linker.LinkableDepType> getPreferredLinkage(CxxPlatform cxxPlatform){
  return Optional.absent();
}

Fixed version (ground truth):
@Override public NativeLinkable.Linkage getPreferredLinkage(CxxPlatform cxxPlatform){
  return Linkage.ANY;
}
Program: 53179
Project: 53179
Buggy source:
@Override public Optional<Linker.LinkableDepType> getPreferredLinkage(CxxPlatform cxxPlatform){
  return Optional.absent();
}

Fixed version (ground truth):
@Override public NativeLinkable.Linkage getPreferredLinkage(CxxPlatform cxxPlatform){
  return Linkage.ANY;
}