nus-yam/ex-repair huggingface dataset:
Program: 53238
Project: 53238
Buggy source:
/** 
 * Initialize the parser, starting buck.py.
 */
private void init() throws IOException {
  ProcessBuilder processBuilder=new ProcessBuilder(buildArgs());
  processBuilder.environment().clear();
  processBuilder.environment().putAll(environment);
  LOG.debug("String_Node_Str",processBuilder.command(),processBuilder.environment());
  buckPyProcess=processBuilder.start();
  LOG.debug("String_Node_Str",buckPyProcess);
  OutputStream stdin=buckPyProcess.getOutputStream();
  InputStream stderr=buckPyProcess.getErrorStream();
  Thread stderrConsumer=Threads.namedThread(ProjectBuildFileParser.class.getSimpleName(),new InputStreamConsumer(stderr,console.getStdErr(),console.getAnsi()));
  stderrConsumer.start();
  buckPyStdinWriter=new BufferedWriter(new OutputStreamWriter(stdin));
  Reader reader=new InputStreamReader(buckPyProcess.getInputStream(),Charsets.UTF_8);
  buckPyStdoutParser=new BuildFileToJsonParser(reader,isServerMode);
}

Fixed version (ground truth):
/** 
 * Initialize the parser, starting buck.py.
 */
private void init() throws IOException {
  ProcessBuilder processBuilder=new ProcessBuilder(buildArgs());
  processBuilder.environment().clear();
  processBuilder.environment().putAll(environment);
  LOG.debug("String_Node_Str",processBuilder.command(),processBuilder.environment());
  buckPyProcess=processBuilder.start();
  LOG.debug("String_Node_Str",buckPyProcess);
  OutputStream stdin=buckPyProcess.getOutputStream();
  InputStream stderr=buckPyProcess.getErrorStream();
  Thread stderrConsumer=Threads.namedThread(ProjectBuildFileParser.class.getSimpleName(),new InputStreamConsumer(stderr,console.getStdErr(),console.getAnsi(),true));
  stderrConsumer.start();
  buckPyStdinWriter=new BufferedWriter(new OutputStreamWriter(stdin));
  Reader reader=new InputStreamReader(buckPyProcess.getInputStream(),Charsets.UTF_8);
  buckPyStdoutParser=new BuildFileToJsonParser(reader,isServerMode);
}
Program: 53239
Project: 53239
Buggy source:
@VisibleForTesting int interactWithProcess(ExecutionContext context,Process process) throws InterruptedException {
  ProcessExecutor executor=context.getProcessExecutor();
  ProcessExecutor.Result result=executor.execute(process,false,false,context.getVerbosity() == Verbosity.SILENT,getStdin());
  stdout=result.getStdout();
  stderr=result.getStderr();
  Verbosity verbosity=context.getVerbosity();
  if (!stderr.isEmpty() && shouldPrintStderr(verbosity)) {
    context.postEvent(ConsoleEvent.severe("String_Node_Str",stderr));
  }
  if (!stdout.isEmpty() && shouldPrintStdout(verbosity)) {
    context.postEvent(ConsoleEvent.info("String_Node_Str",stdout));
  }
  return result.getExitCode();
}

Fixed version (ground truth):
@VisibleForTesting int interactWithProcess(ExecutionContext context,Process process) throws InterruptedException {
  ImmutableSet.Builder<Option> options=ImmutableSet.builder();
  if (shouldFlushStdOutErrAsProgressIsMade()) {
    options.add(Option.PRINT_STD_OUT);
    options.add(Option.PRINT_STD_ERR);
  }
  if (context.getVerbosity() == Verbosity.SILENT) {
    options.add(Option.IS_SILENT);
  }
  ProcessExecutor executor=context.getProcessExecutor();
  ProcessExecutor.Result result=executor.execute(process,options.build(),getStdin());
  stdout=result.getStdout();
  stderr=result.getStderr();
  Verbosity verbosity=context.getVerbosity();
  if (!Strings.isNullOrEmpty(stdout) && shouldPrintStdout(verbosity)) {
    context.postEvent(ConsoleEvent.info("String_Node_Str",stdout));
  }
  if (!Strings.isNullOrEmpty(stderr) && shouldPrintStderr(verbosity)) {
    context.postEvent(ConsoleEvent.severe("String_Node_Str",stderr));
  }
  return result.getExitCode();
}
Program: 53240
Project: 53240
Buggy source:
public InputStreamConsumer(Reader reader,PrintStream printStream,Ansi ansi){
  this.inputReader=new BufferedReader(reader);
  this.printStream=Preconditions.checkNotNull(printStream);
  this.ansi=Preconditions.checkNotNull(ansi);
}

Fixed version (ground truth):
public InputStreamConsumer(Reader reader,PrintStream printStream,Ansi ansi,boolean flagOutputWrittenToStream){
  this.inputReader=new BufferedReader(reader);
  this.printStream=Preconditions.checkNotNull(printStream);
  this.ansi=Preconditions.checkNotNull(ansi);
  this.flagOutputWrittenToStream=flagOutputWrittenToStream;
}
Program: 53241
Project: 53241
Buggy source:
@Override public void run(){
  String line;
  try {
    while ((line=inputReader.readLine()) != null) {
      if (!hasWrittenOutputToPrintStream) {
        printStream.print(ansi.getHighlightedWarningSequence());
        hasWrittenOutputToPrintStream=true;
      }
      printStream.println(line);
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    if (hasWrittenOutputToPrintStream) {
      printStream.print(ansi.getHighlightedResetSequence());
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  String line;
  try {
    while ((line=inputReader.readLine()) != null) {
      if (!hasWrittenOutputToPrintStream && flagOutputWrittenToStream) {
        printStream.print(ansi.getHighlightedWarningSequence());
        hasWrittenOutputToPrintStream=true;
      }
      printStream.print(line + LINE_SEPARATOR);
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    if (hasWrittenOutputToPrintStream) {
      printStream.print(ansi.getHighlightedResetSequence());
    }
  }
}
Program: 53243
Project: 53243
Buggy source:
@Test public void testRunCommandWithArguments() throws IOException {
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",temporaryFolder);
  workspace.setUp();
  ProcessResult result=workspace.runBuckCommand("String_Node_Str","String_Node_Str","String_Node_Str",workspace.getFile("String_Node_Str").toPath().toAbsolutePath().toString());
  result.assertSuccess("String_Node_Str");
  System.out.print(result.getStdout());
  workspace.verify();
}

Fixed version (ground truth):
@Test public void testRunCommandWithArguments() throws IOException {
  ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",temporaryFolder);
  workspace.setUp();
  ProcessResult result=workspace.runBuckCommand("String_Node_Str","String_Node_Str","String_Node_Str",workspace.getFile("String_Node_Str").toPath().toAbsolutePath().toString());
  result.assertSuccess("String_Node_Str");
  assertEquals("String_Node_Str",result.getStdout());
  workspace.verify();
}
Program: 53244
Project: 53244
Buggy source:
/** 
 * Look at all the directories above a given source file, up to the project root, and return the paths to any BUCK files that exist at those locations. These files are the only ones that could define a rule that includes the given source file.
 */
private ImmutableList<Path> possibleBuckFilesForSourceFile(Path sourceFilePath){
  ImmutableList.Builder<Path> possibleBuckFiles=ImmutableList.builder();
  Path dir=sourceFilePath.getParent();
  while (dir != null) {
    Path buckFile=dir.resolve(BuckConstant.BUILD_RULES_FILE_NAME);
    if (projectFilesystem.exists(buckFile)) {
      possibleBuckFiles.add(buckFile);
    }
    dir=dir.getParent();
  }
  Path rootBuckFile=Paths.get(BuckConstant.BUILD_RULES_FILE_NAME);
  if (projectFilesystem.exists(rootBuckFile)) {
    possibleBuckFiles.add(rootBuckFile);
  }
  return possibleBuckFiles.build();
}

Fixed version (ground truth):
/** 
 * Look at all the directories above a given source file, up to the project root, and return the paths to any BUCK files that exist at those locations. These files are the only ones that could define a rule that includes the given source file.
 */
private ImmutableList<Path> possibleBuckFilesForSourceFile(Path sourceFilePath){
  ImmutableList.Builder<Path> possibleBuckFiles=ImmutableList.builder();
  Path dir=sourceFilePath.getParent();
  while (dir != null) {
    Path buckFile=dir.resolve(BuckConstant.BUILD_RULES_FILE_NAME);
    if (projectFilesystem.isFile(buckFile)) {
      possibleBuckFiles.add(buckFile);
    }
    dir=dir.getParent();
  }
  Path rootBuckFile=Paths.get(BuckConstant.BUILD_RULES_FILE_NAME);
  if (projectFilesystem.exists(rootBuckFile)) {
    possibleBuckFiles.add(rootBuckFile);
  }
  return possibleBuckFiles.build();
}
Program: 53245
Project: 53245
Buggy source:
/** 
 * Timestamp event. A timestamped event cannot subsequently being posted and is useful only to pass its timestamp on to another posted event.
 */
public void timestamp(BuckEvent event){
  event.configure(clock.currentTimeMillis(),clock.nanoTime(),threadIdSupplier.get(),buildId);
}

Fixed version (ground truth):
/** 
 * Timestamp event. A timestamped event cannot subsequently being posted and is useful only to pass its timestamp on to another posted event.
 */
public void timestamp(BuckEvent event){
  long nanos=clock.nanoTime();
  event.configure(TimeUnit.NANOSECONDS.toMillis(nanos),nanos,threadIdSupplier.get(),buildId);
}
Program: 53246
Project: 53246
Buggy source:
/** 
 * Timestamp event. A timestamped event cannot subsequently being posted and is useful only to pass its timestamp on to another posted event.
 */
public void timestamp(BuckEvent event){
  long nanos=clock.nanoTime();
  event.configure(TimeUnit.NANOSECONDS.toMillis(nanos),nanos,threadIdSupplier.get(),buildId);
}

Fixed version (ground truth):
/** 
 * Timestamp event. A timestamped event cannot subsequently being posted and is useful only to pass its timestamp on to another posted event.
 */
public void timestamp(BuckEvent event){
  event.configure(clock.currentTimeMillis(),clock.nanoTime(),threadIdSupplier.get(),buildId);
}
Program: 53248
Project: 53248
Buggy source:
@Override public void testFinished(Description description) throws Exception {
  resultListener.testFinished(description);
  resultListener.testRunFinished(result);
  resultListener=null;
  System.setOut(originalOut);
  System.setErr(originalErr);
  stdOutStream.flush();
  stdErrStream.flush();
  int numFailures=result.getFailureCount();
  String className=description.getClassName();
  String methodName=description.getMethodName();
  if (numFailures < 0) {
    throw new IllegalStateException(String.format("String_Node_Str",className,methodName,numFailures,result.getFailures()));
  }
  Failure failure;
  ResultType type;
  if (assumptionFailures.size() > 0) {
    failure=assumptionFailures.get(0);
    type=ResultType.ASSUMPTION_VIOLATION;
  }
 else   if (numFailures == 0) {
    failure=null;
    type=ResultType.SUCCESS;
  }
 else {
    failure=result.getFailures().get(0);
    type=ResultType.FAILURE;
  }
  String stdOut=rawStdOutBytes.size() == 0 ? null : rawStdOutBytes.toString(ENCODING);
  String stdErr=rawStdErrBytes.size() == 0 ? null : rawStdErrBytes.toString(ENCODING);
  results.add(new TestResult(className,methodName,result.getRunTime(),type,failure,stdOut,stdErr));
}

Fixed version (ground truth):
@Override public void testFinished(Description description) throws Exception {
  resultListener.testFinished(description);
  resultListener.testRunFinished(result);
  resultListener=null;
  System.setOut(originalOut);
  System.setErr(originalErr);
  stdOutStream.flush();
  stdErrStream.flush();
  int numFailures=result.getFailureCount();
  String className=description.getClassName();
  String methodName=description.getMethodName();
  if (numFailures < 0) {
    throw new IllegalStateException(String.format("String_Node_Str",className,methodName,numFailures,result.getFailures()));
  }
  Failure failure;
  ResultType type;
  if (assumptionFailure != null) {
    failure=assumptionFailure;
    type=ResultType.ASSUMPTION_VIOLATION;
    assumptionFailure=null;
  }
 else   if (numFailures == 0) {
    failure=null;
    type=ResultType.SUCCESS;
  }
 else {
    failure=result.getFailures().get(0);
    type=ResultType.FAILURE;
  }
  String stdOut=rawStdOutBytes.size() == 0 ? null : rawStdOutBytes.toString(ENCODING);
  String stdErr=rawStdErrBytes.size() == 0 ? null : rawStdErrBytes.toString(ENCODING);
  results.add(new TestResult(className,methodName,result.getRunTime(),type,failure,stdOut,stdErr));
}
Program: 53249
Project: 53249
Buggy source:
/** 
 * The regular listener we created from the singular result, in this class, will not by default treat assumption failures as regular failures, and will not store them.  As a consequence, we store them ourselves!
 */
@Override public void testAssumptionFailure(Failure failure){
  assumptionFailures.add(failure);
  if (resultListener != null) {
    resultListener.testAssumptionFailure(failure);
  }
}

Fixed version (ground truth):
/** 
 * The regular listener we created from the singular result, in this class, will not by default treat assumption failures as regular failures, and will not store them.  As a consequence, we store them ourselves! We store the assumption-failure in a temporary field, which we'll make sure we clear each time we write results.
 */
@Override public void testAssumptionFailure(Failure failure){
  assumptionFailure=failure;
  if (resultListener != null) {
    resultListener.testAssumptionFailure(failure);
  }
}
Program: 53250
Project: 53250
Buggy source:
/** 
 * Format a target string so that the path to the BUCK file its in is easily copyable.
 */
private String formatTarget(BuildTarget buildTarget){
  String targetString=buildTarget.toString();
  return String.format("String_Node_Str",buildTarget.getBuildFilePath(),buildTarget.getShortNameOnly());
}

Fixed version (ground truth):
/** 
 * Format a target string so that the path to the BUCK file its in is easily copyable.
 */
private String formatTarget(BuildTarget buildTarget){
  return String.format("String_Node_Str",buildTarget.getBuildFilePath(),buildTarget.getShortNameOnly());
}
Program: 53252
Project: 53252
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  PythonPackageComponents that=(PythonPackageComponents)o;
  if (modules != null ? !modules.equals(that.modules) : that.modules != null)   return false;
  if (nativeLibraries != null ? !nativeLibraries.equals(that.nativeLibraries) : that.nativeLibraries != null)   return false;
  if (resources != null ? !resources.equals(that.resources) : that.resources != null)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PythonPackageComponents that=(PythonPackageComponents)o;
  if (modules != null ? !modules.equals(that.modules) : that.modules != null) {
    return false;
  }
  if (nativeLibraries != null ? !nativeLibraries.equals(that.nativeLibraries) : that.nativeLibraries != null) {
    return false;
  }
  if (resources != null ? !resources.equals(that.resources) : that.resources != null) {
    return false;
  }
  return true;
}
Program: 53253
Project: 53253
Buggy source:
/** 
 * Verify that owners are correctly detected: - one owner, multiple inputs, json output
 */
@Test public void verifyInputsWithOneOwnerAreCorrectlyReportedInJson() throws CmdLineException, IOException {
  FakeProjectFilesystem filesystem=new FakeProjectFilesystem(){
    @Override public File getFileForRelativePath(    String pathRelativeToProjectRoot){
      return new ExistingFile(getProjectRoot(),pathRelativeToProjectRoot);
    }
  }
;
  String[] args=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  ImmutableSortedSet<Path> inputs=MorePaths.asPaths(ImmutableSortedSet.copyOf(args));
  BuildTarget target=new BuildTarget("String_Node_Str","String_Node_Str");
  BuildRule ownerRule=new StubBuildRule(target,inputs);
  MutableDirectedGraph<BuildRule> mutableGraph=new MutableDirectedGraph<BuildRule>();
  mutableGraph.addNode(ownerRule);
  DependencyGraph graph=new DependencyGraph(mutableGraph);
  AuditOwnerOptions options=getOptions(args);
  AuditOwnerCommand command=createAuditOwnerCommand(filesystem);
  AuditOwnerCommand.OwnersReport report=command.generateOwnersReport(graph,options);
  command.printOwnersOnlyJsonReport(report);
  String EXPECTED_JSON=Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(EXPECTED_JSON,console.getTextWrittenToStdOut());
  assertEquals("String_Node_Str",console.getTextWrittenToStdErr());
}

Fixed version (ground truth):
/** 
 * Verify that owners are correctly detected: - one owner, multiple inputs, json output
 */
@Test public void verifyInputsWithOneOwnerAreCorrectlyReportedInJson() throws CmdLineException, IOException {
  FakeProjectFilesystem filesystem=new FakeProjectFilesystem(){
    @Override public File getFileForRelativePath(    String pathRelativeToProjectRoot){
      return new ExistingFile(getProjectRoot(),pathRelativeToProjectRoot);
    }
  }
;
  String[] args=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  ImmutableSortedSet<Path> inputs=MorePaths.asPaths(ImmutableSortedSet.copyOf(args));
  BuildTarget target=new BuildTarget("String_Node_Str","String_Node_Str");
  BuildRule ownerRule=new StubBuildRule(target,inputs);
  MutableDirectedGraph<BuildRule> mutableGraph=new MutableDirectedGraph<BuildRule>();
  mutableGraph.addNode(ownerRule);
  DependencyGraph graph=new DependencyGraph(mutableGraph);
  AuditOwnerOptions options=getOptions(args);
  AuditOwnerCommand command=createAuditOwnerCommand(filesystem);
  AuditOwnerCommand.OwnersReport report=command.generateOwnersReport(graph,options);
  command.printOwnersOnlyJsonReport(report);
  String expectedJson=Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(expectedJson,console.getTextWrittenToStdOut());
  assertEquals("String_Node_Str",console.getTextWrittenToStdErr());
}
Program: 53254
Project: 53254
Buggy source:
@Override public int compare(File file1,File file2){
  long lastModifiedTimeDifference=file2.lastModified() - file1.lastModified();
  if (lastModifiedTimeDifference != 0) {
    return (int)lastModifiedTimeDifference;
  }
  return file1.toPath().normalize().compareTo(file2.toPath().normalize());
}

Fixed version (ground truth):
@Override public int compare(File file1,File file2){
  long lastModifiedTimeDifference=file2.lastModified() - file1.lastModified();
  if (lastModifiedTimeDifference != 0) {
    return Long.signum(lastModifiedTimeDifference);
  }
  return file1.toPath().normalize().compareTo(file2.toPath().normalize());
}
Program: 53256
Project: 53256
Buggy source:
private int execute(ImmutableList<String> command,ImmutableMap<String,String> environment){
  Preconditions.checkNotNull(command);
  ProcessBuilder processBuilder=new ProcessBuilder(command);
  processBuilder.directory(workingDirectory);
  for (  ImmutableMap.Entry<String,String> entry : environment.entrySet()) {
    processBuilder.environment().put(entry.getKey(),entry.getValue());
  }
  try {
    Process process=processBuilder.start();
    int exitCode;
    Future<String> stdoutFuture=readStream(process.getInputStream());
    Future<String> stderrFuture=readStream(process.getErrorStream());
    exitCode=process.waitFor();
    stdout=stdoutFuture.get();
    stderr=stderrFuture.get();
    return exitCode;
  }
 catch (  IOException e) {
    LOG.error(e);
  }
catch (  ExecutionException e) {
    LOG.error(e);
  }
catch (  InterruptedException e) {
    LOG.error(e);
  }
  return -1;
}

Fixed version (ground truth):
public int execute(String... args){
  ImmutableList<String> command=ImmutableList.<String>builder().add(buckPath).addAll(ImmutableList.copyOf(args)).build();
  return execute(command,ImmutableMap.<String,String>of());
}
Program: 53257
Project: 53257
Buggy source:
@Override public List<Step> getBuildSteps(BuildContext context,BuildableContext buildableContext) throws IOException {
  if (filteredResourcesProvider.getResDirectories().isEmpty()) {
    buildableContext.addMetadata(STRING_ASSETS_ZIP_HASH,Hashing.sha1().hashInt(0).toString());
    return ImmutableList.of();
  }
  ImmutableList.Builder<Step> steps=ImmutableList.builder();
  Path pathToBaseDir=getPathToStringAssetsDir();
  Path pathToDirContainingAssetsDir=pathToBaseDir.resolve("String_Node_Str");
  steps.add(new MakeCleanDirectoryStep(pathToDirContainingAssetsDir));
  Path pathToStrings=pathToDirContainingAssetsDir.resolve("String_Node_Str").resolve("String_Node_Str");
  Path pathToStringAssetsZip=getPathToStringAssetsZip();
  steps.add(new MakeCleanDirectoryStep(pathToStrings));
  steps.add(new CompileStringsStep(filteredResourcesProvider.getNonEnglishStringFiles(),uberRDotJava.getPathToGeneratedRDotJavaSrcFiles(),pathToStrings));
  steps.add(new ZipStep(pathToStringAssetsZip,ImmutableSet.<Path>of(),false,ZipStep.MAX_COMPRESSION_LEVEL,pathToDirContainingAssetsDir));
  steps.add(new RecordFileSha1Step(pathToStringAssetsZip,STRING_ASSETS_ZIP_HASH,buildableContext));
  return steps.build();
}

Fixed version (ground truth):
@Override public List<Step> getBuildSteps(BuildContext context,BuildableContext buildableContext) throws IOException {
  if (filteredResourcesProvider.getResDirectories().isEmpty()) {
    buildableContext.addMetadata(STRING_ASSETS_ZIP_HASH,Hashing.sha1().hashInt(0).toString());
    return ImmutableList.of();
  }
  ImmutableList.Builder<Step> steps=ImmutableList.builder();
  Path pathToBaseDir=getPathToStringAssetsDir();
  Path pathToDirContainingAssetsDir=pathToBaseDir.resolve("String_Node_Str");
  steps.add(new MakeCleanDirectoryStep(pathToDirContainingAssetsDir));
  Path pathToStrings=pathToDirContainingAssetsDir.resolve("String_Node_Str").resolve("String_Node_Str");
  Path pathToStringAssetsZip=getPathToStringAssetsZip();
  steps.add(new MakeCleanDirectoryStep(pathToStrings));
  steps.add(new CompileStringsStep(filteredResourcesProvider.getNonEnglishStringFiles(),uberRDotJava.getPathToGeneratedRDotJavaSrcFiles(),pathToStrings));
  steps.add(new ZipStep(pathToStringAssetsZip,ImmutableSet.<Path>of(),false,ZipStep.MAX_COMPRESSION_LEVEL,pathToDirContainingAssetsDir));
  steps.add(new RecordFileSha1Step(pathToStringAssetsZip,STRING_ASSETS_ZIP_HASH,buildableContext));
  buildableContext.recordArtifact(pathToStringAssetsZip);
  return steps.build();
}
Program: 53258
Project: 53258
Buggy source:
private Parser getParserFromDaemon(Optional<NGContext> context,ProjectFilesystem projectFilesystem,BuckConfig config,Console console,CommandEvent commandEvent,BuckEventBus eventBus) throws IOException {
  Daemon daemon=getDaemon(projectFilesystem,config,console);
  daemon.watchClient(context.get());
  daemon.watchFileSystem(console,commandEvent,eventBus);
  daemon.initWebServer();
  return daemon.getParser();
}

Fixed version (ground truth):
private Parser getParserFromDaemon(Optional<NGContext> context,ProjectFilesystem projectFilesystem,BuckConfig config,KnownBuildRuleTypes knownBuildRuleTypes,AndroidDirectoryResolver androidDirectoryResolver,Console console,CommandEvent commandEvent,BuckEventBus eventBus) throws IOException {
  Daemon daemon=getDaemon(projectFilesystem,config,knownBuildRuleTypes,androidDirectoryResolver,console);
  daemon.watchClient(context.get());
  daemon.watchFileSystem(console,commandEvent,eventBus);
  daemon.initWebServer();
  return daemon.getParser();
}
Program: 53259
Project: 53259
Buggy source:
private Optional<WebServer> getWebServerIfDaemon(Optional<NGContext> context,ProjectFilesystem projectFilesystem,BuckConfig config,Console console) throws IOException {
  if (context.isPresent()) {
    return getDaemon(projectFilesystem,config,console).getWebServer();
  }
  return Optional.absent();
}

Fixed version (ground truth):
private Optional<WebServer> getWebServerIfDaemon(Optional<NGContext> context,ProjectFilesystem projectFilesystem,BuckConfig config,KnownBuildRuleTypes knownBuildRuleTypes,AndroidDirectoryResolver androidDirectoryResolver,Console console) throws IOException {
  if (context.isPresent()) {
    Daemon daemon=getDaemon(projectFilesystem,config,knownBuildRuleTypes,androidDirectoryResolver,console);
    return daemon.getWebServer();
  }
  return Optional.absent();
}
Program: 53261
Project: 53261
Buggy source:
public Daemon(ProjectFilesystem projectFilesystem,BuckConfig config,Console console) throws IOException {
  this.config=Preconditions.checkNotNull(config);
  this.console=Preconditions.checkNotNull(console);
  this.hashCache=new DefaultFileHashCache(projectFilesystem,console);
  this.parser=new Parser(projectFilesystem,KnownBuildRuleTypes.getDefault(),console,config.getPythonInterpreter(),config.getTempFilePatterns(),createRuleKeyBuilderFactory(hashCache));
  this.fileEventBus=new EventBus("String_Node_Str");
  this.filesystemWatcher=createWatcher(projectFilesystem);
  fileEventBus.register(parser);
  fileEventBus.register(hashCache);
  webServer=createWebServer(config,console,projectFilesystem);
  JavaUtilsLoggingBuildListener.ensureLogFileIsWritten(projectFilesystem);
}

Fixed version (ground truth):
public Daemon(ProjectFilesystem projectFilesystem,KnownBuildRuleTypes knownBuildRuleTypes,AndroidDirectoryResolver androidDirectoryResolver,BuckConfig config,Console console) throws IOException {
  this.config=Preconditions.checkNotNull(config);
  this.console=Preconditions.checkNotNull(console);
  this.hashCache=new DefaultFileHashCache(projectFilesystem,console);
  this.parser=new Parser(projectFilesystem,knownBuildRuleTypes,console,config.getPythonInterpreter(),config.getTempFilePatterns(),createRuleKeyBuilderFactory(hashCache));
  this.androidDirectoryResolver=Preconditions.checkNotNull(androidDirectoryResolver);
  this.fileEventBus=new EventBus("String_Node_Str");
  this.filesystemWatcher=createWatcher(projectFilesystem);
  fileEventBus.register(parser);
  fileEventBus.register(hashCache);
  webServer=createWebServer(config,console,projectFilesystem);
  JavaUtilsLoggingBuildListener.ensureLogFileIsWritten(projectFilesystem);
}
Program: 53262
Project: 53262
Buggy source:
/** 
 * Get or create Daemon.
 */
private Daemon getDaemon(ProjectFilesystem filesystem,BuckConfig config,Console console) throws IOException {
  if (daemon == null) {
    daemon=new Daemon(filesystem,config,console);
  }
 else {
    File parserRoot=daemon.getParser().getProjectRoot();
    if (!filesystem.getProjectRoot().equals(parserRoot)) {
      throw new HumanReadableException(String.format("String_Node_Str",filesystem.getProjectRoot(),parserRoot));
    }
    if (!daemon.getConfig().equals(config)) {
      daemon.close();
      daemon=new Daemon(filesystem,config,console);
    }
  }
  return daemon;
}

Fixed version (ground truth):
/** 
 * Get or create Daemon.
 */
private Daemon getDaemon(ProjectFilesystem filesystem,BuckConfig config,KnownBuildRuleTypes knownBuildRuleTypes,AndroidDirectoryResolver androidDirectoryResolver,Console console) throws IOException {
  if (daemon == null) {
    daemon=new Daemon(filesystem,knownBuildRuleTypes,androidDirectoryResolver,config,console);
  }
 else {
    File parserRoot=daemon.getParser().getProjectRoot();
    if (!filesystem.getProjectRoot().equals(parserRoot)) {
      throw new HumanReadableException(String.format("String_Node_Str",filesystem.getProjectRoot(),parserRoot));
    }
    if (!daemon.getConfig().equals(config) || !daemon.getAndroidDirectoryResolver().equals(androidDirectoryResolver)) {
      daemon.close();
      daemon=new Daemon(filesystem,knownBuildRuleTypes,androidDirectoryResolver,config,console);
    }
  }
  return daemon;
}
Program: 53263
Project: 53263
Buggy source:
@Test public void whenSourceInputRemovedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckdCommand("String_Node_Str","String_Node_Str").assertSuccess();
  String fileName="String_Node_Str";
  assertTrue("String_Node_Str",workspace.getFile(fileName).delete());
  waitForChange(Paths.get(fileName));
  try {
    workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  java.lang.RuntimeException e) {
    assertThat("String_Node_Str",e.getMessage(),Matchers.containsString(fileName));
  }
}

Fixed version (ground truth):
@Test public void whenSourceInputRemovedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckdCommand("String_Node_Str","String_Node_Str").assertSuccess();
  String fileName="String_Node_Str";
  assertTrue("String_Node_Str",workspace.getFile(fileName).delete());
  waitForChange(Paths.get(fileName));
  try {
    workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  java.lang.RuntimeException e) {
    assertThat("String_Node_Str",e.getMessage(),containsString(fileName));
  }
}
Program: 53264
Project: 53264
Buggy source:
@Test public void whenAppBuckFileRemovedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  ProjectWorkspace.ProcessResult result=workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
  result.assertSuccess();
  String fileName="String_Node_Str";
  assertTrue("String_Node_Str",workspace.getFile(fileName).delete());
  waitForChange(Paths.get(fileName));
  try {
    workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  HumanReadableException e) {
    assertThat("String_Node_Str",e.getMessage(),Matchers.containsString(fileName));
  }
}

Fixed version (ground truth):
@Test public void whenAppBuckFileRemovedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  ProjectWorkspace.ProcessResult result=workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
  result.assertSuccess();
  String fileName="String_Node_Str";
  assertTrue("String_Node_Str",workspace.getFile(fileName).delete());
  waitForChange(Paths.get(fileName));
  try {
    workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  HumanReadableException e) {
    assertThat("String_Node_Str",e.getMessage(),containsString(fileName));
  }
}
Program: 53265
Project: 53265
Buggy source:
@Test public void whenAppBuckFileInvalidatedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckdCommand("String_Node_Str","String_Node_Str").assertSuccess();
  String fileName="String_Node_Str";
  Files.write("String_Node_Str".getBytes(Charsets.US_ASCII),workspace.getFile(fileName));
  waitForChange(Paths.get(fileName));
  ProjectWorkspace.ProcessResult result=workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
  assertThat("String_Node_Str",result.getStderr(),Matchers.containsString("String_Node_Str"));
  result.assertFailure();
}

Fixed version (ground truth):
@Test public void whenAppBuckFileInvalidatedThenRebuildFails() throws IOException, InterruptedException {
  final ProjectWorkspace workspace=TestDataHelper.createProjectWorkspaceForScenario(this,"String_Node_Str",tmp);
  workspace.setUp();
  workspace.runBuckdCommand("String_Node_Str","String_Node_Str").assertSuccess();
  String fileName="String_Node_Str";
  Files.write("String_Node_Str".getBytes(Charsets.US_ASCII),workspace.getFile(fileName));
  waitForChange(Paths.get(fileName));
  ProjectWorkspace.ProcessResult result=workspace.runBuckdCommand("String_Node_Str","String_Node_Str");
  assertThat("String_Node_Str",result.getStderr(),containsString("String_Node_Str"));
  result.assertFailure();
}
Program: 53266
Project: 53266
Buggy source:
public InputResolver(Path primaryOutputPath,Supplier<Set<Path>> primaryInputsToDex,Optional<Path> secondaryOutputDir,Optional<Supplier<Multimap<Path,Path>>> secondaryOutputToInputs){
  this.primaryOutputPath=Preconditions.checkNotNull(primaryOutputPath);
  this.primaryInputsToDex=Preconditions.checkNotNull(primaryInputsToDex);
  Preconditions.checkArgument(!(secondaryOutputDir.isPresent() ^ secondaryOutputToInputs.isPresent()),"String_Node_Str");
  this.secondaryOutputDir=secondaryOutputDir;
  this.secondaryOutputToInputs=secondaryOutputToInputs;
}

Fixed version (ground truth):
public InputResolver(Path primaryOutputPath,Supplier<Set<Path>> primaryInputsToDex,Optional<Path> secondaryOutputDir,Optional<Supplier<Multimap<Path,Path>>> secondaryOutputToInputs){
  this.primaryOutputPath=Preconditions.checkNotNull(primaryOutputPath);
  this.primaryInputsToDex=Preconditions.checkNotNull(primaryInputsToDex);
  Preconditions.checkArgument(!(secondaryOutputDir.isPresent() ^ secondaryOutputToInputs.isPresent()),"String_Node_Str" + "String_Node_Str");
  this.secondaryOutputDir=secondaryOutputDir;
  this.secondaryOutputToInputs=secondaryOutputToInputs;
}
Program: 53269
Project: 53269
Buggy source:
/** 
 * The step to produce the .dex file will be determined by the file extension of outputPath, much as   {@code dx} itself chooses whether to embed the dex inside a jar/zip based on the destinationfile passed to it.
 */
static Step createDxStepForDxPseudoRule(Iterable<Path> filesToDex,String outputPath,EnumSet<Option> dxOptions){
  if (outputPath.endsWith(DexStore.XZ.getExtension())) {
    List<Step> steps=Lists.newArrayList();
    String tempDexJarOutput=outputPath.replaceAll("String_Node_Str","String_Node_Str");
    steps.add(new DxStep(tempDexJarOutput,filesToDex,dxOptions));
    String repackedJar=outputPath.replaceAll("String_Node_Str","String_Node_Str");
    steps.add(new RepackZipEntriesStep(tempDexJarOutput,repackedJar,ImmutableSet.of("String_Node_Str"),ZipStep.MIN_COMPRESSION_LEVEL));
    steps.add(new RmStep(tempDexJarOutput,true));
    steps.add(new XzStep(repackedJar));
    return new CompositeStep(steps);
  }
 else   if (outputPath.endsWith(DexStore.JAR.getExtension())) {
    return new DxStep(outputPath,filesToDex,dxOptions);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",outputPath));
  }
}

Fixed version (ground truth):
/** 
 * The step to produce the .dex file will be determined by the file extension of outputPath, much as   {@code dx} itself chooses whether to embed the dex inside a jar/zip based on the destinationfile passed to it.
 */
static Step createDxStepForDxPseudoRule(Iterable<Path> filesToDex,String outputPath,EnumSet<Option> dxOptions){
  if (outputPath.endsWith(DexStore.XZ.getExtension())) {
    List<Step> steps=Lists.newArrayList();
    String tempDexJarOutput=outputPath.replaceAll("String_Node_Str","String_Node_Str");
    steps.add(new DxStep(tempDexJarOutput,filesToDex,dxOptions));
    String repackedJar=outputPath.replaceAll("String_Node_Str","String_Node_Str");
    steps.add(new RepackZipEntriesStep(tempDexJarOutput,repackedJar,ImmutableSet.of("String_Node_Str"),ZipStep.MIN_COMPRESSION_LEVEL));
    steps.add(new RmStep(tempDexJarOutput,true));
    steps.add(new XzStep(repackedJar));
    return new CompositeStep(steps);
  }
 else   if (outputPath.endsWith(DexStore.JAR.getExtension()) || outputPath.endsWith("String_Node_Str")) {
    return new DxStep(outputPath,filesToDex,dxOptions);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",outputPath));
  }
}
Program: 53270
Project: 53270
Buggy source:
protected void runStepInternal(final Step step,final Optional<BuildTarget> buildTarget) throws StepFailedException {
  Preconditions.checkNotNull(step);
  if (context.getVerbosity().shouldPrintCommand()) {
    context.getStdErr().println(step.getDescription(context));
  }
  context.postEvent(StepEvent.started(step,step.getDescription(context)));
  int exitCode=step.execute(context);
  context.postEvent(StepEvent.finished(step,step.getDescription(context),exitCode));
  if (exitCode != 0) {
    throw StepFailedException.createForFailingStep(step,context,exitCode,buildTarget);
  }
}

Fixed version (ground truth):
protected void runStepInternal(final Step step,final Optional<BuildTarget> buildTarget) throws StepFailedException {
  Preconditions.checkNotNull(step);
  if (context.getVerbosity().shouldPrintCommand()) {
    context.getStdErr().println(step.getDescription(context));
  }
  context.postEvent(StepEvent.started(step,step.getDescription(context)));
  int exitCode=1;
  try {
    exitCode=step.execute(context);
  }
 catch (  Throwable t) {
    throw StepFailedException.createForFailingStepWithException(step,context,t,buildTarget);
  }
 finally {
    context.postEvent(StepEvent.finished(step,step.getDescription(context),exitCode));
  }
  if (exitCode != 0) {
    throw StepFailedException.createForFailingStepWithExitCode(step,context,exitCode,buildTarget);
  }
}
Program: 53271
Project: 53271
Buggy source:
@Test public void testCreateForFailingStepWithoutBuildTarget(){
  final int exitCode=17;
  Step step=new FakeStep("String_Node_Str","String_Node_Str",exitCode);
  ExecutionContext context=TestExecutionContext.newInstance();
  StepFailedException exception=StepFailedException.createForFailingStep(step,context,exitCode,Optional.<BuildTarget>absent());
  assertEquals(step,exception.getStep());
  assertEquals(exitCode,exception.getExitCode());
  assertEquals("String_Node_Str",exception.getMessage());
}

Fixed version (ground truth):
@Test public void testCreateForFailingStepWithoutBuildTarget(){
  final int exitCode=17;
  Step step=new FakeStep("String_Node_Str","String_Node_Str",exitCode);
  ExecutionContext context=TestExecutionContext.newInstance();
  StepFailedException exception=StepFailedException.createForFailingStepWithException(step,context,new IOException("String_Node_Str"),Optional.<BuildTarget>absent());
  assertEquals(step,exception.getStep());
  assertEquals(1,exception.getExitCode());
  assertEquals("String_Node_Str",exception.getMessage());
}
Program: 53272
Project: 53272
Buggy source:
@Test public void testCreateForFailingStepWithBuildTarget(){
  final int exitCode=17;
  Step step=new FakeStep("String_Node_Str","String_Node_Str",exitCode);
  ExecutionContext context=TestExecutionContext.newInstance();
  BuildTarget buildTarget=new BuildTarget("String_Node_Str","String_Node_Str");
  StepFailedException exception=StepFailedException.createForFailingStep(step,context,exitCode,Optional.of(buildTarget));
  assertEquals(step,exception.getStep());
  assertEquals(exitCode,exception.getExitCode());
  assertEquals("String_Node_Str",exception.getMessage());
}

Fixed version (ground truth):
@Test public void testCreateForFailingStepWithBuildTarget(){
  final int exitCode=17;
  Step step=new FakeStep("String_Node_Str","String_Node_Str",exitCode);
  ExecutionContext context=TestExecutionContext.newInstance();
  BuildTarget buildTarget=new BuildTarget("String_Node_Str","String_Node_Str");
  StepFailedException exception=StepFailedException.createForFailingStepWithException(step,context,new IOException("String_Node_Str"),Optional.of(buildTarget));
  assertEquals(step,exception.getStep());
  assertEquals(1,exception.getExitCode());
  assertEquals("String_Node_Str",exception.getMessage());
}
Program: 53273
Project: 53273
Buggy source:
/** 
 * Returns a list of command-line options to pass to javac.  These options reflect the configuration of this javac command.
 * @param context the ExecutionContext with in which javac will run
 * @return list of String command-line options.
 */
@VisibleForTesting protected ImmutableList<String> getOptions(ExecutionContext context,Set<String> buildClasspathEntries){
  ImmutableList.Builder<String> builder=ImmutableList.builder();
  ProjectFilesystem filesystem=context.getProjectFilesystem();
  AnnotationProcessingDataDecorator decorator;
  if (pathToOutputAbiFile.isPresent()) {
    abiKeyFile=filesystem.getFileForRelativePath(pathToOutputAbiFile.get());
    decorator=new AbiWritingAnnotationProcessingDataDecorator(abiKeyFile);
  }
 else {
    decorator=AnnotationProcessingDataDecorators.identity();
  }
  javacOptions.appendOptionsToList(builder,context.getProjectFilesystem().getPathRelativizer(),decorator);
  if (context.getVerbosity().shouldUseVerbosityFlagIfAvailable()) {
    builder.add("String_Node_Str");
  }
  Function<String,Path> pathRelativizer=filesystem.getPathRelativizer();
  builder.add("String_Node_Str").add(pathRelativizer.apply(outputDirectory).toString());
  if (!buildClasspathEntries.isEmpty()) {
    String classpath=Joiner.on(File.pathSeparator).join(Iterables.transform(buildClasspathEntries,pathRelativizer));
    builder.add("String_Node_Str",classpath);
  }
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Returns a list of command-line options to pass to javac.  These options reflect the configuration of this javac command.
 * @param context the ExecutionContext with in which javac will run
 * @return list of String command-line options.
 */
@VisibleForTesting protected ImmutableList<String> getOptions(ExecutionContext context,Set<String> buildClasspathEntries){
  ImmutableList.Builder<String> builder=ImmutableList.builder();
  ProjectFilesystem filesystem=context.getProjectFilesystem();
  AnnotationProcessingDataDecorator decorator;
  if (pathToOutputAbiFile.isPresent()) {
    abiKeyFile=filesystem.getFileForRelativePath(pathToOutputAbiFile.get());
    decorator=new AbiWritingAnnotationProcessingDataDecorator(abiKeyFile);
  }
 else {
    decorator=AnnotationProcessingDataDecorators.identity();
  }
  javacOptions.appendOptionsToList(builder,context.getProjectFilesystem().getPathRelativizer(),decorator);
  if (context.getVerbosity().shouldUseVerbosityFlagIfAvailable()) {
    builder.add("String_Node_Str");
  }
  Function<String,Path> pathRelativizer=filesystem.getPathRelativizer();
  builder.add("String_Node_Str").add(pathRelativizer.apply(outputDirectory).toString());
  if (!buildClasspathEntries.isEmpty()) {
    String classpath=Joiner.on(File.pathSeparator).join(Iterables.transform(buildClasspathEntries,pathRelativizer));
    builder.add("String_Node_Str",classpath);
  }
 else {
    builder.add("String_Node_Str","String_Node_Str");
  }
  return builder.build();
}
Program: 53274
Project: 53274
Buggy source:
@Test public void testGetDescription() throws IOException {
  JavacInMemoryStep javac=createJavac(false);
  ExecutionContext executionContext=createExecutionContext();
  String pathToOutputDir=new File(tmp.getRoot(),"String_Node_Str").getAbsolutePath();
  String pathToAbiFile=new File(tmp.getRoot(),"String_Node_Str").getAbsolutePath();
  assertEquals(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",AbiWritingAnnotationProcessingDataDecorator.ABI_PROCESSOR_CLASSPATH,AbiWriterProtocol.ABI_ANNOTATION_PROCESSOR_CLASS_NAME,AbiWriterProtocol.PARAM_ABI_OUTPUT_FILE,pathToAbiFile,pathToOutputDir),javac.getDescription(executionContext));
}

Fixed version (ground truth):
@Test public void testGetDescription() throws IOException {
  JavacInMemoryStep javac=createJavac(false);
  ExecutionContext executionContext=createExecutionContext();
  String pathToOutputDir=new File(tmp.getRoot(),"String_Node_Str").getAbsolutePath();
  String pathToAbiFile=new File(tmp.getRoot(),"String_Node_Str").getAbsolutePath();
  assertEquals(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",AbiWritingAnnotationProcessingDataDecorator.ABI_PROCESSOR_CLASSPATH,AbiWriterProtocol.ABI_ANNOTATION_PROCESSOR_CLASS_NAME,AbiWriterProtocol.PARAM_ABI_OUTPUT_FILE,pathToAbiFile,pathToOutputDir),javac.getDescription(executionContext));
}
Program: 53275
Project: 53275
Buggy source:
/** 
 * A set of paths to subtrees that do not contain source files, build files or files that could affect either (buck-out, .idea, .buckd, buck-cache, .git, etc.).
 */
public ImmutableSet<String> getIgnorePaths(){
  final ImmutableMap<String,String> projectConfig=getEntriesForSection("String_Node_Str");
  final String IGNORE_KEY="String_Node_Str";
  ImmutableSet.Builder<String> builder=ImmutableSet.builder();
  builder.add(BuckConstant.BUCK_OUTPUT_DIRECTORY);
  builder.add("String_Node_Str");
  String buckdDir=System.getProperty(BUCK_BUCKD_DIR_KEY,"String_Node_Str");
  Path cacheDir=getCacheDir();
  for (  String path : ImmutableList.of(buckdDir,cacheDir.toString())) {
    if (!path.isEmpty() && path.charAt(0) != '/') {
      builder.add(path);
    }
  }
  if (projectConfig.containsKey(IGNORE_KEY)) {
    builder.addAll(Splitter.on(',').omitEmptyStrings().trimResults().split(projectConfig.get(IGNORE_KEY)));
  }
  return ImmutableSet.<String>builder().addAll(Iterables.transform(builder.build(),new Function<String,String>(){
    @Override public String apply(    String path){
      return MorePaths.newPathInstance(path).toString();
    }
  }
)).build();
}

Fixed version (ground truth):
/** 
 * A set of paths to subtrees that do not contain source files, build files or files that could affect either (buck-out, .idea, .buckd, buck-cache, .git, etc.).  May return absolute paths as well as relative paths.
 */
public ImmutableSet<Path> getIgnorePaths(){
  final ImmutableMap<String,String> projectConfig=getEntriesForSection("String_Node_Str");
  final String IGNORE_KEY="String_Node_Str";
  ImmutableSet.Builder<Path> builder=ImmutableSet.builder();
  builder.add(Paths.get(BuckConstant.BUCK_OUTPUT_DIRECTORY));
  builder.add(Paths.get("String_Node_Str"));
  Path buckdDir=Paths.get(System.getProperty(BUCK_BUCKD_DIR_KEY,"String_Node_Str"));
  Path cacheDir=getCacheDir();
  for (  Path path : ImmutableList.of(buckdDir,cacheDir)) {
    if (!path.toString().isEmpty()) {
      builder.add(path);
    }
  }
  if (projectConfig.containsKey(IGNORE_KEY)) {
    builder.addAll(MorePaths.asPaths(Splitter.on(',').omitEmptyStrings().trimResults().split(projectConfig.get(IGNORE_KEY))));
  }
  return builder.build();
}
Program: 53276
Project: 53276
Buggy source:
private boolean addSourceFolders(Module module,@Nullable BuildRule buildRule,@Nullable ImmutableList<SourceRoot> sourceRoots,boolean isTestSource){
  if (buildRule == null || sourceRoots == null) {
    return false;
  }
  if (buildRule instanceof AndroidBinaryRule && sourceRoots.isEmpty()) {
    return false;
  }
  if (sourceRoots.isEmpty()) {
    String url="String_Node_Str";
    String packagePrefix=javaPackageFinder.findJavaPackageForPath(module.pathToImlFile);
    SourceFolder sourceFolder=new SourceFolder(url,isTestSource,packagePrefix);
    module.sourceFolders.add(sourceFolder);
  }
 else {
    for (    SourceRoot sourceRoot : sourceRoots) {
      SourceFolder sourceFolder=new SourceFolder(String.format("String_Node_Str",sourceRoot.getName()),isTestSource);
      module.sourceFolders.add(sourceFolder);
    }
  }
  for (  String relativePath : this.buildFileTree.getChildPaths(buildRule.getBuildTarget())) {
    String excludeFolderUrl="String_Node_Str" + relativePath;
    SourceFolder excludeFolder=new SourceFolder(excludeFolderUrl,false);
    module.excludeFolders.add(excludeFolder);
  }
  if ("String_Node_Str".equals(buildRule.getBuildTarget().getBasePathWithSlash())) {
    for (    String path : projectFilesystem.getIgnorePaths()) {
      module.excludeFolders.add(new SourceFolder(String.format("String_Node_Str",path),false));
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean addSourceFolders(Module module,@Nullable BuildRule buildRule,@Nullable ImmutableList<SourceRoot> sourceRoots,boolean isTestSource){
  if (buildRule == null || sourceRoots == null) {
    return false;
  }
  if (buildRule.getProperties().is(PACKAGING) && sourceRoots.isEmpty()) {
    return false;
  }
  if (sourceRoots.isEmpty()) {
    String url="String_Node_Str";
    String packagePrefix=javaPackageFinder.findJavaPackageForPath(module.pathToImlFile);
    SourceFolder sourceFolder=new SourceFolder(url,isTestSource,packagePrefix);
    module.sourceFolders.add(sourceFolder);
  }
 else {
    for (    SourceRoot sourceRoot : sourceRoots) {
      SourceFolder sourceFolder=new SourceFolder(String.format("String_Node_Str",sourceRoot.getName()),isTestSource);
      module.sourceFolders.add(sourceFolder);
    }
  }
  for (  String relativePath : this.buildFileTree.getChildPaths(buildRule.getBuildTarget())) {
    String excludeFolderUrl="String_Node_Str" + relativePath;
    SourceFolder excludeFolder=new SourceFolder(excludeFolderUrl,false);
    module.excludeFolders.add(excludeFolder);
  }
  return true;
}