nus-yam/ex-repair huggingface dataset:
Program: 52983
Project: 52983
Buggy source:
@Override public void outputTrace(BuildId buildId) throws InterruptedException {
  executor.submit(() -> {
    try {
      outputStream.write(String.format("String_Node_Str",exitCode.orElse(-1)).getBytes(Charsets.UTF_8));
      outputStream.close();
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str");
    }
  }
);
  executor.shutdown();
  if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS,TimeUnit.SECONDS)) {
    String error="String_Node_Str";
    LOG.error(error);
  }
}

Fixed version (ground truth):
@Override public void outputTrace(BuildId buildId) throws InterruptedException {
  @SuppressWarnings("String_Node_Str") Future<?> unused=executor.submit(() -> {
    try {
      outputStream.write(String.format("String_Node_Str",exitCode.orElse(-1)).getBytes(Charsets.UTF_8));
      outputStream.close();
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str");
    }
  }
);
  executor.shutdown();
  if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS,TimeUnit.SECONDS)) {
    String error="String_Node_Str";
    LOG.error(error);
  }
}
Program: 52984
Project: 52984
Buggy source:
private void scheduleDownloadSpeedCalculation(){
  long calculationInterval=DOWNLOAD_SPEED_CALCULATION_INTERVAL.toMillis();
  TimeUnit timeUnit=TimeUnit.MILLISECONDS;
  scheduler.scheduleAtFixedRate(this::calculateDownloadSpeedInLastInterval,calculationInterval,calculationInterval,timeUnit);
}

Fixed version (ground truth):
private void scheduleDownloadSpeedCalculation(){
  long calculationInterval=DOWNLOAD_SPEED_CALCULATION_INTERVAL.toMillis();
  TimeUnit timeUnit=TimeUnit.MILLISECONDS;
  @SuppressWarnings("String_Node_Str") ScheduledFuture<?> unused=scheduler.scheduleAtFixedRate(this::calculateDownloadSpeedInLastInterval,calculationInterval,calculationInterval,timeUnit);
}
Program: 52985
Project: 52985
Buggy source:
private void flushLogLinesIfNeeded(){
  if (logLinesCount > minLinesForAutoFlush) {
    outputExecutor.submit(new Callable<Void>(){
      @Override public Void call() throws Exception {
        try {
          flushLogLines();
        }
 catch (        IOException e) {
          LOG.error(e,"String_Node_Str");
        }
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
private void flushLogLinesIfNeeded(){
  if (logLinesCount > minLinesForAutoFlush) {
    @SuppressWarnings("String_Node_Str") Future<?> unused=outputExecutor.submit(() -> {
      try {
        flushLogLines();
      }
 catch (      IOException e) {
        LOG.error(e,"String_Node_Str");
      }
      return null;
    }
);
  }
}
Program: 52986
Project: 52986
Buggy source:
private void flushLogLines() throws IOException {
  List<String> linesToFlush;
synchronized (lock) {
    linesToFlush=logLines;
    logLines=Lists.newArrayList();
    logLinesCount=logLines.size();
  }
  if (linesToFlush.isEmpty()) {
    return;
  }
  Path logFile=getLogFilePath();
  projectFilesystem.createParentDirs(logFile);
  try (FileOutputStream stream=new FileOutputStream(logFile.toString(),true);PrintWriter writer=new PrintWriter(stream)){
    for (    String line : linesToFlush) {
      writer.println(line);
    }
  }
 }

Fixed version (ground truth):
private void flushLogLines() throws IOException {
  List<String> linesToFlush;
synchronized (lock) {
    linesToFlush=logLines;
    logLines=Lists.newArrayList();
    logLinesCount=logLines.size();
  }
  if (linesToFlush.isEmpty()) {
    return;
  }
  Path logFile=getLogFilePath();
  projectFilesystem.createParentDirs(logFile);
  try (FileOutputStream stream=new FileOutputStream(logFile.toString(),true);OutputStreamWriter streamWriter=new OutputStreamWriter(stream,StandardCharsets.UTF_8);PrintWriter writer=new PrintWriter(streamWriter)){
    for (    String line : linesToFlush) {
      writer.println(line);
    }
  }
 }
Program: 52987
Project: 52987
Buggy source:
@Override public void assertInProjectFilesystem(Object ruleName,ProjectFilesystem projectFilesystem){
  Preconditions.checkState(projectFilesystem == this.projectFilesystem,"String_Node_Str" + "String_Node_Str",ruleName,this.projectFilesystem.getRootPath(),projectFilesystem.getRootPath());
}

Fixed version (ground truth):
@Override public void assertInProjectFilesystem(Object ruleName,ProjectFilesystem projectFilesystem){
  Preconditions.checkState(this.projectFilesystem.getRootPath().equals(projectFilesystem.getRootPath()),"String_Node_Str" + "String_Node_Str",ruleName,this.projectFilesystem.getRootPath(),projectFilesystem.getRootPath());
}
Program: 52988
Project: 52988
Buggy source:
@Override public void run() throws Throwable {
  Level stdOutLogLevel=Level.INFO;
  Level stdErrLogLevel=Level.WARNING;
  String unparsedStdOutLogLevel=System.getProperty(STD_OUT_LOG_LEVEL_PROPERTY);
  String unparsedStdErrLogLevel=System.getProperty(STD_ERR_LOG_LEVEL_PROPERTY);
  if (unparsedStdOutLogLevel != null) {
    stdOutLogLevel=Level.parse(unparsedStdOutLogLevel);
  }
  if (unparsedStdErrLogLevel != null) {
    stdErrLogLevel=Level.parse(unparsedStdErrLogLevel);
  }
  for (  String className : testClassNames) {
    List<TestResult> results=new ArrayList<>();
    Class<?> testClass=null;
    boolean shouldRunAsTestClass;
    try {
      testClass=Class.forName(className);
      shouldRunAsTestClass=mightBeATestClass(testClass);
    }
 catch (    ClassNotFoundException|LinkageError t) {
      int indexForLastPartOfName=Math.max(className.lastIndexOf('.'),className.lastIndexOf('$')) + 1;
      if (className.indexOf("String_Node_Str",indexForLastPartOfName) != -1) {
        results.add(TestResult.forFailureAtInitialization(className,t));
      }
      shouldRunAsTestClass=false;
    }
    if (shouldRunAsTestClass) {
      RecordingFilter filter=new RecordingFilter();
      JUnitCore jUnitCore=new JUnitCore();
      Runner suite=new Computer().getSuite(createRunnerBuilder(),new Class<?>[]{testClass});
      Request request=Request.runner(suite);
      request=request.filterWith(filter);
      jUnitCore.addListener(new TestListener(results,stdOutLogLevel,stdErrLogLevel));
      jUnitCore.run(request);
      results=combineResults(results,filter.filteredOut);
    }
    writeResult(className,results);
  }
}

Fixed version (ground truth):
@Override public void run() throws Throwable {
  Level stdOutLogLevel=Level.INFO;
  Level stdErrLogLevel=Level.WARNING;
  String unparsedStdOutLogLevel=System.getProperty(STD_OUT_LOG_LEVEL_PROPERTY);
  String unparsedStdErrLogLevel=System.getProperty(STD_ERR_LOG_LEVEL_PROPERTY);
  if (unparsedStdOutLogLevel != null) {
    stdOutLogLevel=Level.parse(unparsedStdOutLogLevel);
  }
  if (unparsedStdErrLogLevel != null) {
    stdErrLogLevel=Level.parse(unparsedStdErrLogLevel);
  }
  for (  String className : testClassNames) {
    final Class<?> testClass=Class.forName(className);
    List<TestResult> results=new ArrayList<>();
    RecordingFilter filter=new RecordingFilter();
    if (mightBeATestClass(testClass)) {
      JUnitCore jUnitCore=new JUnitCore();
      Runner suite=new Computer().getSuite(createRunnerBuilder(),new Class<?>[]{testClass});
      Request request=Request.runner(suite);
      request=request.filterWith(filter);
      jUnitCore.addListener(new TestListener(results,stdOutLogLevel,stdErrLogLevel));
      jUnitCore.run(request);
    }
    List<TestResult> actualResults=combineResults(results,filter.filteredOut);
    writeResult(className,actualResults);
  }
}
Program: 52989
Project: 52989
Buggy source:
@Override public void run() throws Throwable {
  Level stdOutLogLevel=Level.INFO;
  Level stdErrLogLevel=Level.WARNING;
  String unparsedStdOutLogLevel=System.getProperty(STD_OUT_LOG_LEVEL_PROPERTY);
  String unparsedStdErrLogLevel=System.getProperty(STD_ERR_LOG_LEVEL_PROPERTY);
  if (unparsedStdOutLogLevel != null) {
    stdOutLogLevel=Level.parse(unparsedStdOutLogLevel);
  }
  if (unparsedStdErrLogLevel != null) {
    stdErrLogLevel=Level.parse(unparsedStdErrLogLevel);
  }
  for (  String className : testClassNames) {
    final Class<?> testClass=Class.forName(className);
    List<TestResult> results=new ArrayList<>();
    RecordingFilter filter=new RecordingFilter();
    if (mightBeATestClass(testClass)) {
      JUnitCore jUnitCore=new JUnitCore();
      Runner suite=new Computer().getSuite(createRunnerBuilder(),new Class<?>[]{testClass});
      Request request=Request.runner(suite);
      request=request.filterWith(filter);
      jUnitCore.addListener(new TestListener(results,stdOutLogLevel,stdErrLogLevel));
      jUnitCore.run(request);
    }
    List<TestResult> actualResults=combineResults(results,filter.filteredOut);
    writeResult(className,actualResults);
  }
}

Fixed version (ground truth):
@Override public void run() throws Throwable {
  Level stdOutLogLevel=Level.INFO;
  Level stdErrLogLevel=Level.WARNING;
  String unparsedStdOutLogLevel=System.getProperty(STD_OUT_LOG_LEVEL_PROPERTY);
  String unparsedStdErrLogLevel=System.getProperty(STD_ERR_LOG_LEVEL_PROPERTY);
  if (unparsedStdOutLogLevel != null) {
    stdOutLogLevel=Level.parse(unparsedStdOutLogLevel);
  }
  if (unparsedStdErrLogLevel != null) {
    stdErrLogLevel=Level.parse(unparsedStdErrLogLevel);
  }
  for (  String className : testClassNames) {
    List<TestResult> results=new ArrayList<>();
    Class<?> testClass=null;
    boolean shouldRunAsTestClass;
    try {
      testClass=Class.forName(className);
      shouldRunAsTestClass=mightBeATestClass(testClass);
    }
 catch (    ClassNotFoundException|LinkageError t) {
      int indexForLastPartOfName=Math.max(className.lastIndexOf('.'),className.lastIndexOf('$')) + 1;
      if (className.indexOf("String_Node_Str",indexForLastPartOfName) != -1) {
        results.add(TestResult.forFailureAtInitialization(className,t));
      }
      shouldRunAsTestClass=false;
    }
    if (shouldRunAsTestClass) {
      RecordingFilter filter=new RecordingFilter();
      JUnitCore jUnitCore=new JUnitCore();
      Runner suite=new Computer().getSuite(createRunnerBuilder(),new Class<?>[]{testClass});
      Request request=Request.runner(suite);
      request=request.filterWith(filter);
      jUnitCore.addListener(new TestListener(results,stdOutLogLevel,stdErrLogLevel));
      jUnitCore.run(request);
      results=combineResults(results,filter.filteredOut);
    }
    writeResult(className,results);
  }
}
Program: 52990
Project: 52990
Buggy source:
private BuildRule generateDebugLauncherRule(){
  BuildRuleParams debugParams=params.copyWithChanges(addDebugFlavor(params.getBuildTarget()),Suppliers.ofInstance(ImmutableSortedSet.of()),Suppliers.ofInstance(ImmutableSortedSet.of()));
  OcamlDebugLauncher debugLauncher=new OcamlDebugLauncher(debugParams,pathResolver,new OcamlDebugLauncherStep.Args(ocamlContext.getOcamlDebug().get(),ocamlContext.getBytecodeOutput(),ocamlContext.getOcamlInput(),ocamlContext.getBytecodeIncludeFlags()));
  resolver.addToIndex(debugLauncher);
  return debugLauncher;
}

Fixed version (ground truth):
private BuildRule generateDebugLauncherRule(){
  BuildRuleParams debugParams=params.copyWithChanges(addDebugFlavor(params.getBuildTarget()),Suppliers.ofInstance(ImmutableSortedSet.of()),Suppliers.ofInstance(ImmutableSortedSet.of()));
  OcamlDebugLauncher debugLauncher=new OcamlDebugLauncher(debugParams,new OcamlDebugLauncherStep.Args(ocamlContext.getOcamlDebug().get(),ocamlContext.getBytecodeOutput(),ocamlContext.getOcamlInput(),ocamlContext.getBytecodeIncludeFlags()));
  resolver.addToIndex(debugLauncher);
  return debugLauncher;
}
Program: 52991
Project: 52991
Buggy source:
@Override public ImmutableList<Step> getBuildSteps(BuildContext context,BuildableContext buildableContext){
  buildableContext.recordArtifact(args.getOutput());
  return ImmutableList.of(new MkdirStep(getProjectFilesystem(),args.getOutput().getParent()),new OcamlDebugLauncherStep(getProjectFilesystem(),getResolver(),args));
}

Fixed version (ground truth):
@Override public ImmutableList<Step> getBuildSteps(BuildContext context,BuildableContext buildableContext){
  buildableContext.recordArtifact(args.getOutput());
  return ImmutableList.of(new MkdirStep(getProjectFilesystem(),args.getOutput().getParent()),new OcamlDebugLauncherStep(getProjectFilesystem(),context.getSourcePathResolver(),args));
}
Program: 52992
Project: 52992
Buggy source:
public OcamlDebugLauncher(BuildRuleParams params,SourcePathResolver resolver,OcamlDebugLauncherStep.Args args){
  super(params,resolver);
  this.args=args;
}

Fixed version (ground truth):
public OcamlDebugLauncher(BuildRuleParams params,OcamlDebugLauncherStep.Args args){
  super(params);
  this.args=args;
}
Program: 52993
Project: 52993
Buggy source:
@SuppressWarnings("String_Node_Str") @Value.Default public Optional<Path> getStubBinaryPath(){
  return Optional.empty();
}

Fixed version (ground truth):
public abstract Optional<Path> getStubBinaryPath();
Program: 52995
Project: 52995
Buggy source:
@Test public void testNonHasMavenCoordinatesBuildRule() throws Exception {
  assumeFalse("String_Node_Str",FakeBuildRule.class.isInstance(HasMavenCoordinates.class));
  SourcePathResolver sourcePathResolver=new SourcePathResolver(new SourcePathRuleFinder(resolver));
  BuildRule rule=new FakeBuildRule("String_Node_Str",sourcePathResolver);
  try {
    expander.getMavenCoordinates(rule);
    fail("String_Node_Str");
  }
 catch (  MacroException e) {
    assertTrue("String_Node_Str",e.getMessage().contains("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testNonHasMavenCoordinatesBuildRule() throws Exception {
  assumeFalse("String_Node_Str",FakeBuildRule.class.isAssignableFrom(HasMavenCoordinates.class));
  SourcePathResolver sourcePathResolver=new SourcePathResolver(new SourcePathRuleFinder(resolver));
  BuildRule rule=new FakeBuildRule("String_Node_Str",sourcePathResolver);
  try {
    expander.getMavenCoordinates(rule);
    fail("String_Node_Str");
  }
 catch (  MacroException e) {
    assertTrue("String_Node_Str",e.getMessage().contains("String_Node_Str"));
  }
}
Program: 52996
Project: 52996
Buggy source:
private void flushEventListeners(Console console,BuildId buildId,ImmutableList<BuckEventListener> eventListeners){
  for (  BuckEventListener eventListener : eventListeners) {
    try {
      eventListener.outputTrace(buildId);
    }
 catch (    RuntimeException e) {
      PrintStream stdErr=console.getStdErr();
      stdErr.println("String_Node_Str");
      e.printStackTrace(stdErr);
    }
  }
}

Fixed version (ground truth):
private void flushEventListeners(Console console,BuildId buildId,ImmutableList<BuckEventListener> eventListeners) throws InterruptedException {
  for (  BuckEventListener eventListener : eventListeners) {
    try {
      eventListener.outputTrace(buildId);
    }
 catch (    RuntimeException e) {
      PrintStream stdErr=console.getStdErr();
      stdErr.println("String_Node_Str");
      e.printStackTrace(stdErr);
    }
  }
}
Program: 52997
Project: 52997
Buggy source:
/** 
 * Output any trace data collected to the backing store.
 * @param buildId for the trace to be written.
 */
public void outputTrace(BuildId buildId);

Fixed version (ground truth):
/** 
 * Output any trace data collected to the backing store.
 * @param buildId for the trace to be written.
 */
public void outputTrace(BuildId buildId) throws InterruptedException ;
Program: 52998
Project: 52998
Buggy source:
@Override public void outputTrace(BuildId buildId){
  try {
    outputStream.write(String.format("String_Node_Str",exitCode.orElse(-1)).getBytes(Charsets.UTF_8));
    outputStream.close();
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str");
  }
  executor.shutdown();
}

Fixed version (ground truth):
@Override public void outputTrace(BuildId buildId) throws InterruptedException {
  executor.submit(() -> {
    try {
      outputStream.write(String.format("String_Node_Str",exitCode.orElse(-1)).getBytes(Charsets.UTF_8));
      outputStream.close();
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str");
    }
  }
);
  executor.shutdown();
  if (!executor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS,TimeUnit.SECONDS)) {
    String error="String_Node_Str";
    LOG.error(error);
  }
}
Program: 52999
Project: 52999
Buggy source:
private void writeToLog(final String prefix,final Object obj){
  executor.submit(() -> {
    try {
      outputStream.write((prefix + "String_Node_Str").getBytes(Charsets.UTF_8));
      outputStream.write(objectWriter.writeValueAsBytes(obj));
      outputStream.write(NEWLINE);
      outputStream.flush();
    }
 catch (    JsonProcessingException e) {
      LOG.warn("String_Node_Str",prefix);
    }
catch (    IOException e) {
      LOG.debug("String_Node_Str",BuckConstant.BUCK_MACHINE_LOG_FILE_NAME,e);
    }
  }
);
}

Fixed version (ground truth):
private void writeToLog(final String prefix,final Object obj){
  executor.submit(() -> {
    try {
      byte[] serializedObj=objectWriter.writeValueAsBytes(obj);
      outputStream.write((prefix + "String_Node_Str").getBytes(Charsets.UTF_8));
      outputStream.write(serializedObj);
      outputStream.write(NEWLINE);
      outputStream.flush();
    }
 catch (    JsonProcessingException e) {
      LOG.warn("String_Node_Str",prefix);
    }
catch (    IOException e) {
      LOG.debug("String_Node_Str",BuckConstant.BUCK_MACHINE_LOG_FILE_NAME,e);
    }
  }
);
}
Program: 53001
Project: 53001
Buggy source:
@Override public final int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  Preconditions.checkNotNull(binary,BINARY_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(output,OUTPUT_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(oldCompDir,OLD_COMPDIR_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(updatedCompDir,NEW_COMPDIR_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(!binary.equals(output),BINARY_OPTION + "String_Node_Str" + OUTPUT_OPTION);
  Preconditions.checkArgument(oldCompDir.length() >= updatedCompDir.length(),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!oldCompDir.equals(updatedCompDir),"String_Node_Str");
  Files.copy(binary,output,StandardCopyOption.REPLACE_EXISTING);
  return invokeWithParams(params);
}

Fixed version (ground truth):
@Override public final int runWithoutHelp(CommandRunnerParams params) throws IOException, InterruptedException {
  Preconditions.checkNotNull(binary,BINARY_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(output,OUTPUT_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(oldCompDir,OLD_COMPDIR_OPTION + "String_Node_Str");
  Preconditions.checkNotNull(updatedCompDir,NEW_COMPDIR_OPTION + "String_Node_Str");
  Preconditions.checkState(!binary.equals(output),BINARY_OPTION + "String_Node_Str" + OUTPUT_OPTION);
  Preconditions.checkArgument(oldCompDir.length() >= updatedCompDir.length(),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!oldCompDir.equals(updatedCompDir),"String_Node_Str");
  Files.copy(binary,output,StandardCopyOption.REPLACE_EXISTING);
  return invokeWithParams(params);
}
Program: 53002
Project: 53002
Buggy source:
@Override public CxxPreprocessorInput getCxxPreprocessorInput(final CxxPlatform cxxPlatform,HeaderVisibility headerVisibility) throws NoSuchBuildTargetException {
  CxxPreprocessorInput.Builder builder=CxxPreprocessorInput.builder();
switch (headerVisibility) {
case PUBLIC:
    if (Preconditions.checkNotNull(hasHeaders(cxxPlatform))) {
      CxxPreprocessables.addHeaderSymlinkTree(builder,getBuildTarget(),ruleResolver,cxxPlatform,headerVisibility,CxxPreprocessables.IncludeType.SYSTEM);
    }
  builder.putAllPreprocessorFlags(Preconditions.checkNotNull(getExportedPreprocessorFlags(cxxPlatform)));
builder.addAllFrameworks(args.frameworks);
final Iterable<SourcePath> includePaths=args.includeDirs.stream().map(input -> PrebuiltCxxLibraryDescription.getApplicableSourcePath(params.getBuildTarget(),params.getCellRoots(),params.getProjectFilesystem(),ruleResolver,cxxPlatform,input,Optional.empty())).collect(MoreCollectors.toImmutableList());
for (SourcePath includePath : includePaths) {
builder.addIncludes(CxxHeadersDir.of(CxxPreprocessables.IncludeType.SYSTEM,includePath));
}
return builder.build();
case PRIVATE:
return builder.build();
}
throw new RuntimeException("String_Node_Str" + headerVisibility);
}

Fixed version (ground truth):
@Override public CxxPreprocessorInput getCxxPreprocessorInput(final CxxPlatform cxxPlatform,HeaderVisibility headerVisibility) throws NoSuchBuildTargetException {
  CxxPreprocessorInput.Builder builder=CxxPreprocessorInput.builder();
switch (headerVisibility) {
case PUBLIC:
    if (hasHeaders(cxxPlatform)) {
      CxxPreprocessables.addHeaderSymlinkTree(builder,getBuildTarget(),ruleResolver,cxxPlatform,headerVisibility,CxxPreprocessables.IncludeType.SYSTEM);
    }
  builder.putAllPreprocessorFlags(Preconditions.checkNotNull(getExportedPreprocessorFlags(cxxPlatform)));
builder.addAllFrameworks(args.frameworks);
final Iterable<SourcePath> includePaths=args.includeDirs.stream().map(input -> PrebuiltCxxLibraryDescription.getApplicableSourcePath(params.getBuildTarget(),params.getCellRoots(),params.getProjectFilesystem(),ruleResolver,cxxPlatform,input,Optional.empty())).collect(MoreCollectors.toImmutableList());
for (SourcePath includePath : includePaths) {
builder.addIncludes(CxxHeadersDir.of(CxxPreprocessables.IncludeType.SYSTEM,includePath));
}
return builder.build();
case PRIVATE:
return builder.build();
}
throw new RuntimeException("String_Node_Str" + headerVisibility);
}
Program: 53004
Project: 53004
Buggy source:
@Override public void evaluate() throws Throwable {
  Future<Throwable> submitted=executor.submit(callable);
  try {
    Throwable result=submitted.get(timeout,TimeUnit.MILLISECONDS);
    if (result == null) {
      return;
    }
    if (result instanceof TimeoutException) {
      throw new Exception("String_Node_Str",result);
    }
    throw result;
  }
 catch (  TimeoutException e) {
    System.err.printf("String_Node_Str",testName);
    for (    Map.Entry<Thread,StackTraceElement[]> t : Thread.getAllStackTraces().entrySet()) {
      Thread thread=t.getKey();
      System.err.printf("String_Node_Str",thread.getName(),thread.getId(),thread.getId());
      System.err.printf("String_Node_Str",thread.getState());
      for (      StackTraceElement element : t.getValue()) {
        System.err.printf("String_Node_Str",element);
      }
    }
    submitted.cancel(true);
    String message=String.format("String_Node_Str",testName,timeout);
    throw new Exception(message);
  }
}

Fixed version (ground truth):
@Override public void evaluate() throws Throwable {
  Future<Throwable> submitted=executor.submit(callable);
  try {
    Throwable result=submitted.get(timeout,TimeUnit.MILLISECONDS);
    if (result == null) {
      return;
    }
    if (result instanceof TimeoutException) {
      throw new Exception("String_Node_Str",result);
    }
    throw result;
  }
 catch (  TimeoutException e) {
    System.err.printf("String_Node_Str",testName);
    for (    Map.Entry<Thread,StackTraceElement[]> t : Thread.getAllStackTraces().entrySet()) {
      Thread thread=t.getKey();
      System.err.printf("String_Node_Str",thread.getName(),thread.getId());
      System.err.printf("String_Node_Str",thread.getState());
      for (      StackTraceElement element : t.getValue()) {
        System.err.printf("String_Node_Str",element);
      }
    }
    submitted.cancel(true);
    String message=String.format("String_Node_Str",testName,timeout);
    throw new Exception(message);
  }
}
Program: 53005
Project: 53005
Buggy source:
@Nullable public ListenableFuture<Void> getShutdownFullyCompleteFuture(){
  Preconditions.checkState(closing.get(),"String_Node_Str");
  return Preconditions.checkNotNull(shutdownFuture);
}

Fixed version (ground truth):
@Nullable public synchronized ListenableFuture<Void> getShutdownFullyCompleteFuture(){
  Preconditions.checkState(closing.get(),"String_Node_Str");
  return Preconditions.checkNotNull(shutdownFuture);
}
Program: 53006
Project: 53006
Buggy source:
public static AppleCxxPlatform build(AppleSdk targetSdk,String minVersion,String targetArchitecture,AppleSdkPaths sdkPaths,BuckConfig buckConfig,AppleConfig appleConfig,Optional<ProcessExecutor> processExecutor,Optional<AppleToolchain> swiftToolChain){
  return buildWithExecutableChecker(targetSdk,minVersion,targetArchitecture,sdkPaths,buckConfig,appleConfig,new ExecutableFinder(),processExecutor,swiftToolChain);
}

Fixed version (ground truth):
public static AppleCxxPlatform build(ProjectFilesystem filesystem,AppleSdk targetSdk,String minVersion,String targetArchitecture,AppleSdkPaths sdkPaths,BuckConfig buckConfig,AppleConfig appleConfig,Optional<ProcessExecutor> processExecutor,Optional<AppleToolchain> swiftToolChain){
  return buildWithExecutableChecker(filesystem,targetSdk,minVersion,targetArchitecture,sdkPaths,buckConfig,appleConfig,new ExecutableFinder(),processExecutor,swiftToolChain);
}
Program: 53009
Project: 53009
Buggy source:
/** 
 * Creates a CxxPlatform with a defined flavor for a CxxBuckConfig with default values provided from another default CxxPlatform
 */
public static CxxPlatform copyPlatformWithFlavorAndConfig(CxxPlatform defaultPlatform,CxxBuckConfig config,Flavor flavor){
  return CxxPlatforms.build(flavor,config,defaultPlatform.getAs(),defaultPlatform.getAspp(),defaultPlatform.getCc(),defaultPlatform.getCxx(),defaultPlatform.getCpp(),defaultPlatform.getCxxpp(),defaultPlatform.getLd(),defaultPlatform.getLdflags(),defaultPlatform.getStrip(),defaultPlatform.getAr(),defaultPlatform.getRanlib(),defaultPlatform.getSymbolNameTool(),defaultPlatform.getAsflags(),defaultPlatform.getAsppflags(),defaultPlatform.getCflags(),defaultPlatform.getCppflags(),defaultPlatform.getSharedLibraryExtension(),defaultPlatform.getSharedLibraryVersionedExtensionFormat(),defaultPlatform.getStaticLibraryExtension(),defaultPlatform.getObjectFileExtension(),Optional.of(defaultPlatform.getCompilerDebugPathSanitizer()),Optional.of(defaultPlatform.getAssemblerDebugPathSanitizer()),defaultPlatform.getFlagMacros());
}

Fixed version (ground truth):
/** 
 * Creates a CxxPlatform with a defined flavor for a CxxBuckConfig with default values provided from another default CxxPlatform
 */
public static CxxPlatform copyPlatformWithFlavorAndConfig(CxxPlatform defaultPlatform,CxxBuckConfig config,Flavor flavor){
  return CxxPlatforms.build(flavor,config,defaultPlatform.getAs(),defaultPlatform.getAspp(),defaultPlatform.getCc(),defaultPlatform.getCxx(),defaultPlatform.getCpp(),defaultPlatform.getCxxpp(),defaultPlatform.getLd(),defaultPlatform.getLdflags(),defaultPlatform.getStrip(),defaultPlatform.getAr(),defaultPlatform.getRanlib(),defaultPlatform.getSymbolNameTool(),defaultPlatform.getAsflags(),defaultPlatform.getAsppflags(),defaultPlatform.getCflags(),defaultPlatform.getCppflags(),defaultPlatform.getSharedLibraryExtension(),defaultPlatform.getSharedLibraryVersionedExtensionFormat(),defaultPlatform.getStaticLibraryExtension(),defaultPlatform.getObjectFileExtension(),defaultPlatform.getCompilerDebugPathSanitizer(),defaultPlatform.getAssemblerDebugPathSanitizer(),defaultPlatform.getFlagMacros());
}
Program: 53011
Project: 53011
Buggy source:
public OcamlBuckConfig(Platform platform,BuckConfig delegate){
  this.delegate=delegate;
  this.cxxPlatform=DefaultCxxPlatforms.build(platform,new CxxBuckConfig(delegate));
}

Fixed version (ground truth):
public OcamlBuckConfig(Platform platform,ProjectFilesystem filesystem,BuckConfig delegate){
  this.delegate=delegate;
  this.cxxPlatform=DefaultCxxPlatforms.build(platform,filesystem,new CxxBuckConfig(delegate));
}
Program: 53014
Project: 53014
Buggy source:
@Override public int compareTo(ModuleIndexEntry o){
  if (this == o) {
    return 0;
  }
  return getFilePath().compareTo(o.getFilePath());
}

Fixed version (ground truth):
@Override public int compareTo(ModuleIndexEntry o){
  if (this == o) {
    return 0;
  }
  return getFilePath().toString().replace(File.separatorChar,' ').compareTo(o.getFilePath().toString().replace(File.separatorChar,' '));
}
Program: 53015
Project: 53015
Buggy source:
@Value.Derived public Optional<String> getInitialError(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.of(getInitialCause(throwable).getClass().getName());
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<String> getInitialError(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.ofNullable(getInitialCause(throwable).getClass().getName());
  }
  return Optional.empty();
}
Program: 53016
Project: 53016
Buggy source:
@Value.Derived public Optional<String> getOrigin(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.of(getThrowableOrigin(throwable));
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<String> getOrigin(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.ofNullable(getThrowableOrigin(throwable));
  }
  return Optional.empty();
}
Program: 53017
Project: 53017
Buggy source:
@Value.Derived public String getMessage(){
  Optional<String> initialErr=Optional.empty();
  Optional<String> initialErrorMsg=Optional.empty();
  Optional<String> errorMsg=Optional.empty();
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    initialErr=Optional.of(getInitialCause(throwable).getClass().getName());
    if (throwable.getMessage() != null) {
      initialErrorMsg=Optional.of(getInitialCause(throwable).getLocalizedMessage());
    }
  }
  String message=getRecord().getMessage();
  if (message != null) {
    errorMsg=Optional.of(message);
  }
  StringBuilder sb=new StringBuilder();
  for (  Optional<String> field : ImmutableList.of(initialErr,initialErrorMsg,errorMsg)) {
    sb.append(field.orElse("String_Node_Str"));
    if (field.isPresent()) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(getRecord().getLoggerName());
  return sb.toString();
}

Fixed version (ground truth):
@Value.Derived public String getMessage(){
  Optional<String> initialErr=Optional.empty();
  Optional<String> initialErrorMsg=Optional.empty();
  Optional<String> errorMsg=Optional.empty();
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    initialErr=Optional.ofNullable(getInitialCause(throwable).getClass().getName());
    if (throwable.getMessage() != null) {
      initialErrorMsg=Optional.ofNullable(getInitialCause(throwable).getLocalizedMessage());
    }
  }
  errorMsg=Optional.ofNullable(getRecord().getMessage());
  StringBuilder sb=new StringBuilder();
  for (  Optional<String> field : ImmutableList.of(initialErr,initialErrorMsg,errorMsg)) {
    sb.append(field.orElse("String_Node_Str"));
    if (field.isPresent()) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(getRecord().getLoggerName());
  return sb.toString();
}
Program: 53018
Project: 53018
Buggy source:
@Value.Derived public Optional<String> getLogger(){
  String logger=getRecord().getLoggerName();
  if (logger != null) {
    return Optional.of(logger);
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<String> getLogger(){
  return Optional.ofNullable(getRecord().getLoggerName());
}
Program: 53019
Project: 53019
Buggy source:
@Value.Derived public Optional<StackTraceElement[]> getStack(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.of(throwable.getStackTrace());
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<StackTraceElement[]> getStack(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null) {
    return Optional.ofNullable(throwable.getStackTrace());
  }
  return Optional.empty();
}
Program: 53020
Project: 53020
Buggy source:
@Value.Derived public Optional<String> getBuildUuid(){
  String buildUuid=MAPPER.threadIdToCommandId(getRecord().getThreadID());
  if (buildUuid != null) {
    return Optional.of(buildUuid);
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<String> getBuildUuid(){
  String buildUuid=MAPPER.threadIdToCommandId(getRecord().getThreadID());
  return Optional.ofNullable(buildUuid);
}
Program: 53021
Project: 53021
Buggy source:
@Value.Derived public Optional<String> getErrorMessage(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null && throwable.getMessage() != null) {
    return Optional.of(throwable.getMessage());
  }
  return Optional.empty();
}

Fixed version (ground truth):
@Value.Derived public Optional<String> getErrorMessage(){
  Throwable throwable=getRecord().getThrown();
  if (throwable != null && throwable.getMessage() != null) {
    return Optional.ofNullable(throwable.getMessage());
  }
  return Optional.empty();
}
Program: 53022
Project: 53022
Buggy source:
/** 
 * Fetch the artifact matching ruleKey and store it to output. If any of the encapsulated ArtifactCaches contains the desired artifact, this method succeeds, and it may store the artifact to one or more of the other encapsulated ArtifactCaches as a side effect.
 */
@Override public CacheResult fetch(RuleKey ruleKey,LazyPath output){
  CacheResult cacheResult=CacheResult.miss();
  for (  ArtifactCache artifactCache : artifactCaches) {
    cacheResult=artifactCache.fetch(ruleKey,output);
    if (cacheResult.getType().isSuccess()) {
      for (      ArtifactCache priorArtifactCache : artifactCaches) {
        if (priorArtifactCache.equals(artifactCache)) {
          break;
        }
        BorrowablePath outputPath;
        if (priorArtifactCache.equals(artifactCaches.get(artifactCaches.size() - 1))) {
          outputPath=BorrowablePath.borrowablePath(output.getUnchecked());
        }
 else {
          outputPath=BorrowablePath.notBorrowablePath(output.getUnchecked());
        }
        priorArtifactCache.store(ArtifactInfo.builder().addRuleKeys(ruleKey).setMetadata(cacheResult.getMetadata()).build(),outputPath);
      }
      return cacheResult;
    }
  }
  return cacheResult;
}

Fixed version (ground truth):
/** 
 * Fetch the artifact matching ruleKey and store it to output. If any of the encapsulated ArtifactCaches contains the desired artifact, this method succeeds, and it may store the artifact to one or more of the other encapsulated ArtifactCaches as a side effect.
 */
@Override public CacheResult fetch(RuleKey ruleKey,LazyPath output){
  CacheResult cacheResult=CacheResult.miss();
  ImmutableList.Builder<ArtifactCache> priorCaches=ImmutableList.builder();
  for (  ArtifactCache artifactCache : artifactCaches) {
    cacheResult=artifactCache.fetch(ruleKey,output);
    if (cacheResult.getType().isSuccess()) {
      break;
    }
    if (artifactCache.isStoreSupported()) {
      priorCaches.add(artifactCache);
    }
  }
  if (cacheResult.getType().isSuccess()) {
    storeToCaches(priorCaches.build(),ArtifactInfo.builder().addRuleKeys(ruleKey).setMetadata(cacheResult.getMetadata()).build(),BorrowablePath.borrowablePath(output.getUnchecked()));
  }
  return cacheResult;
}
Program: 53023
Project: 53023
Buggy source:
/** 
 * Store the artifact to all encapsulated ArtifactCaches.
 */
@Override public ListenableFuture<Void> store(ArtifactInfo info,BorrowablePath output){
  List<ListenableFuture<Void>> storeFutures=Lists.newArrayListWithExpectedSize(writableArtifactCaches.size());
  for (  ArtifactCache artifactCache : writableArtifactCaches) {
    if (output.canBorrow() && artifactCache.equals(writableArtifactCaches.get(writableArtifactCaches.size() - 1))) {
      output=BorrowablePath.borrowablePath(output.getPath());
    }
 else {
      output=BorrowablePath.notBorrowablePath(output.getPath());
    }
    storeFutures.add(artifactCache.store(info,output));
  }
  return Futures.transform(Futures.allAsList(storeFutures),Functions.<Void>constant(null));
}

Fixed version (ground truth):
/** 
 * Store the artifact to all encapsulated ArtifactCaches.
 */
@Override public ListenableFuture<Void> store(ArtifactInfo info,BorrowablePath output){
  return storeToCaches(writableArtifactCaches,info,output);
}
Program: 53024
Project: 53024
Buggy source:
public static Optional<CoreDataModel> createBuildRulesForCoreDataDependencies(TargetGraph targetGraph,BuildRuleParams params,SourcePathResolver sourcePathResolver,String moduleName,AppleCxxPlatform appleCxxPlatform){
  TargetNode<?,?> targetNode=targetGraph.get(params.getBuildTarget());
  ImmutableSet<CoreDataModelDescription.Arg> coreDataModelArgs=AppleBuildRules.collectTransitiveCoreDataModels(targetGraph,ImmutableList.of(targetNode));
  BuildRuleParams coreDataModelParams=params.copyWithChanges(params.getBuildTarget().withAppendedFlavors(AppleAssetCatalog.FLAVOR),Suppliers.ofInstance(ImmutableSortedSet.of()),Suppliers.ofInstance(ImmutableSortedSet.of()));
  if (coreDataModelArgs.isEmpty()) {
    return Optional.empty();
  }
 else {
    return Optional.of(new CoreDataModel(coreDataModelParams,sourcePathResolver,appleCxxPlatform,moduleName,coreDataModelArgs.stream().map(input -> new PathSourcePath(params.getProjectFilesystem(),input.path)).collect(MoreCollectors.toImmutableSet())));
  }
}

Fixed version (ground truth):
public static Optional<CoreDataModel> createBuildRulesForCoreDataDependencies(TargetGraph targetGraph,BuildRuleParams params,SourcePathResolver sourcePathResolver,String moduleName,AppleCxxPlatform appleCxxPlatform){
  TargetNode<?,?> targetNode=targetGraph.get(params.getBuildTarget());
  ImmutableSet<CoreDataModelDescription.Arg> coreDataModelArgs=AppleBuildRules.collectTransitiveCoreDataModels(targetGraph,ImmutableList.of(targetNode));
  BuildRuleParams coreDataModelParams=params.copyWithChanges(params.getBuildTarget().withAppendedFlavors(CoreDataModel.FLAVOR),Suppliers.ofInstance(ImmutableSortedSet.of()),Suppliers.ofInstance(ImmutableSortedSet.of()));
  if (coreDataModelArgs.isEmpty()) {
    return Optional.empty();
  }
 else {
    return Optional.of(new CoreDataModel(coreDataModelParams,sourcePathResolver,appleCxxPlatform,moduleName,coreDataModelArgs.stream().map(input -> new PathSourcePath(params.getProjectFilesystem(),input.path)).collect(MoreCollectors.toImmutableSet())));
  }
}
Program: 53025
Project: 53025
Buggy source:
@Override public void close() throws Exception {
  executorService.shutdown();
  thriftService.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  executorService.shutdown();
  thriftService.close();
}
Program: 53026
Project: 53026
Buggy source:
@Override public void close() throws Exception {
  startedClosing=true;
synchronized (this) {
    try {
      if (filesystem.isDirectory(logDir)) {
        deleteOldLogsIfNeeded(maxScribeOfflineLogsBytes - bytesStoredSoFar);
      }
    }
 catch (    Exception e) {
      LOG.error(e,"String_Node_Str");
    }
    if (logFileStoreStream != null) {
      logFileStoreStream.close();
    }
    storingAvailable=false;
  }
  scribeLogger.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  startedClosing=true;
synchronized (this) {
    try {
      if (filesystem.isDirectory(logDir)) {
        deleteOldLogsIfNeeded(maxScribeOfflineLogsBytes - bytesStoredSoFar);
      }
    }
 catch (    Exception e) {
      LOG.error(e,"String_Node_Str");
    }
    if (logFileStoreStream != null) {
      logFileStoreStream.close();
    }
    storingAvailable=false;
  }
  scribeLogger.close();
}
Program: 53027
Project: 53027
Buggy source:
@Override public void close() throws Exception {
}

Fixed version (ground truth):
@Override public void close() throws IOException {
}
Program: 53028
Project: 53028
Buggy source:
@Override public void close() throws Exception {
}

Fixed version (ground truth):
@Override public void close() throws IOException {
}
Program: 53030
Project: 53030
Buggy source:
@Override public void close() throws Exception {
  offlineScribeLogger.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  offlineScribeLogger.close();
}
Program: 53031
Project: 53031
Buggy source:
/** 
 * Helper method to add coerced elements to the builder.
 */
protected void fill(CellPathResolver cellRoots,ProjectFilesystem filesystem,Path pathRelativeToProjectRoot,C.Builder<T> builder,Object object) throws CoerceFailedException {
  if (object instanceof Collection) {
    for (    Object element : (Iterable<?>)object) {
      T coercedElement=elementTypeCoercer.coerce(cellRoots,filesystem,pathRelativeToProjectRoot,element);
      builder.add(coercedElement);
    }
  }
 else {
    throw CoerceFailedException.simple(object,getOutputClass());
  }
}

Fixed version (ground truth):
/** 
 * Helper method to add coerced elements to the builder.
 */
protected void fill(CellPathResolver cellRoots,ProjectFilesystem filesystem,Path pathRelativeToProjectRoot,ImmutableCollection.Builder<T> builder,Object object) throws CoerceFailedException {
  if (object instanceof Collection) {
    for (    Object element : (Iterable<?>)object) {
      T coercedElement=elementTypeCoercer.coerce(cellRoots,filesystem,pathRelativeToProjectRoot,element);
      builder.add(coercedElement);
    }
  }
 else {
    throw CoerceFailedException.simple(object,getOutputClass());
  }
}
Program: 53032
Project: 53032
Buggy source:
private Pair<Path,Path> findSymlinkRoot(Path symlinkPath){
  for (int componentCount=1; componentCount <= symlinkPath.getNameCount(); componentCount++) {
    Path symlinkSubpath=symlinkPath.subpath(0,componentCount);
    Path realSymlinkSubpath=findRealPath(symlinkSubpath);
    boolean realPathOutsideProject=projectFilesystem.getPathRelativeToProjectRoot(realSymlinkSubpath).isPresent();
    if (realPathOutsideProject) {
      return new Pair<>(projectFilesystem.getPathRelativeToProjectRoot(symlinkSubpath).get(),realSymlinkSubpath);
    }
  }
  throw new RuntimeException(String.format("String_Node_Str",symlinkPath.toAbsolutePath()));
}

Fixed version (ground truth):
private Pair<Path,Path> findSymlinkRoot(Path symlinkPath){
  int projectPathComponents=projectFilesystem.getRootPath().getNameCount();
  for (int pathEndIndex=(projectPathComponents + 1); pathEndIndex <= symlinkPath.getNameCount(); pathEndIndex++) {
    Path symlinkSubpath=symlinkPath.getRoot().resolve(symlinkPath.subpath(0,pathEndIndex));
    Path realSymlinkSubpath=findRealPath(symlinkSubpath);
    boolean realPathOutsideProject=!projectFilesystem.getPathRelativeToProjectRoot(realSymlinkSubpath).isPresent();
    if (realPathOutsideProject) {
      return new Pair<>(projectFilesystem.getPathRelativeToProjectRoot(symlinkSubpath).get(),realSymlinkSubpath);
    }
  }
  throw new RuntimeException(String.format("String_Node_Str",symlinkPath.toAbsolutePath()));
}
Program: 53033
Project: 53033
Buggy source:
private static ImmutableList<String> getCxxppflags(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths){
  ImmutableList.Builder<String> flags=ImmutableList.builder();
  flags.addAll(getCxxRuntimeIncludeFlags(targetConfiguration,toolchainPaths));
  flags.addAll(getCommonIncludes(toolchainPaths));
  flags.addAll(getCommonPreprocessorFlags());
  flags.addAll(getCommonFlags(targetConfiguration,toolchainPaths));
  flags.addAll(getCommonCxxFlags());
  if (targetConfiguration.getCompiler().getType() == NdkCxxPlatformCompiler.Type.GCC) {
    flags.add("String_Node_Str");
  }
  flags.addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType()));
  return flags.build();
}

Fixed version (ground truth):
private static ImmutableList<String> getCxxppflags(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths,ImmutableList<String> sanitizerFlags){
  ImmutableList.Builder<String> flags=ImmutableList.builder();
  flags.addAll(getCxxRuntimeIncludeFlags(targetConfiguration,toolchainPaths));
  flags.addAll(getCommonIncludes(toolchainPaths));
  flags.addAll(getCommonPreprocessorFlags());
  flags.addAll(getCommonFlags(targetConfiguration,toolchainPaths));
  flags.addAll(getCommonCxxFlags());
  flags.addAll(sanitizerFlags);
  if (targetConfiguration.getCompiler().getType() == NdkCxxPlatformCompiler.Type.GCC) {
    flags.add("String_Node_Str");
  }
  flags.addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType()));
  return flags.build();
}
Program: 53034
Project: 53034
Buggy source:
private static ImmutableList<String> getCxxflagsInternal(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths){
  return ImmutableList.<String>builder().addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType())).addAll(getCommonCxxFlags()).addAll(getCommonFlags(targetConfiguration,toolchainPaths)).addAll(getCommonNdkCxxPlatformCompilerFlags()).build();
}

Fixed version (ground truth):
private static ImmutableList<String> getCxxflagsInternal(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths,ImmutableList<String> sanitizerFlags){
  return ImmutableList.<String>builder().addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType())).addAll(getCommonCxxFlags()).addAll(getCommonFlags(targetConfiguration,toolchainPaths)).addAll(getCommonNdkCxxPlatformCompilerFlags()).addAll(sanitizerFlags).build();
}
Program: 53035
Project: 53035
Buggy source:
private static ImmutableList<String> getCppflags(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths){
  return ImmutableList.<String>builder().addAll(getCommonIncludes(toolchainPaths)).addAll(getCommonPreprocessorFlags()).addAll(getCommonFlags(targetConfiguration,toolchainPaths)).addAll(getCommonCFlags()).addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType())).build();
}

Fixed version (ground truth):
private static ImmutableList<String> getCppflags(NdkCxxPlatformTargetConfiguration targetConfiguration,NdkCxxToolchainPaths toolchainPaths,ImmutableList<String> sanitizerFlags){
  return ImmutableList.<String>builder().addAll(getCommonIncludes(toolchainPaths)).addAll(getCommonPreprocessorFlags()).addAll(getCommonFlags(targetConfiguration,toolchainPaths)).addAll(getCommonCFlags()).addAll(sanitizerFlags).addAll(targetConfiguration.getCompilerFlags(targetConfiguration.getCompiler().getType())).build();
}
Program: 53036
Project: 53036
Buggy source:
private NdkCxxToolchainPaths(Path ndkRoot,String ndkVersion,NdkCxxPlatformTargetConfiguration targetConfiguration,String hostName,CxxRuntime cxxRuntime,boolean strict){
  this.cachedPaths=new HashMap<>();
  this.strict=strict;
  this.targetConfiguration=targetConfiguration;
  this.hostName=hostName;
  this.cxxRuntime=cxxRuntime;
  this.ndkRoot=ndkRoot;
  this.ndkVersion=ndkVersion;
  this.ndkMajorVersion=getNdkMajorVersion(ndkVersion);
  Assertions.assertCondition(ndkMajorVersion > 0,"String_Node_Str" + ndkVersion);
}

Fixed version (ground truth):
private NdkCxxToolchainPaths(ProjectFilesystem filesystem,Path ndkRoot,String ndkVersion,NdkCxxPlatformTargetConfiguration targetConfiguration,String hostName,CxxRuntime cxxRuntime,boolean strict){
  this.filesystem=filesystem;
  this.cachedPaths=new HashMap<>();
  this.strict=strict;
  this.targetConfiguration=targetConfiguration;
  this.hostName=hostName;
  this.cxxRuntime=cxxRuntime;
  this.ndkRoot=ndkRoot;
  this.ndkVersion=ndkVersion;
  this.ndkMajorVersion=getNdkMajorVersion(ndkVersion);
  Assertions.assertCondition(ndkMajorVersion > 0,"String_Node_Str" + ndkVersion);
}
Program: 53037
Project: 53037
Buggy source:
NdkCxxToolchainPaths getSanitizedPaths(){
  return new NdkCxxToolchainPaths(Paths.get(ANDROID_NDK_ROOT),ndkVersion,targetConfiguration,BUILD_HOST_SUBST,cxxRuntime,false);
}

Fixed version (ground truth):
NdkCxxToolchainPaths getSanitizedPaths(){
  return new NdkCxxToolchainPaths(filesystem,Paths.get(ANDROID_NDK_ROOT),ndkVersion,targetConfiguration,BUILD_HOST_SUBST,cxxRuntime,false);
}