Program: 53008
Project: 53008
Buggy source:
public static CxxPlatform build(Flavor flavor,final CxxBuckConfig config,CompilerProvider as,PreprocessorProvider aspp,CompilerProvider cc,CompilerProvider cxx,PreprocessorProvider cpp,PreprocessorProvider cxxpp,LinkerProvider ld,Iterable<String> ldFlags,Tool strip,final Archiver ar,final Tool ranlib,final SymbolNameTool nm,ImmutableList<String> asflags,ImmutableList<String> asppflags,ImmutableList<String> cflags,ImmutableList<String> cppflags,String sharedLibraryExtension,String sharedLibraryVersionedExtensionFormat,String staticLibraryExtension,String objectFileExtension,Optional<DebugPathSanitizer> compilerDebugPathSanitizer,Optional<DebugPathSanitizer> assemblerDebugPathSanitizer,ImmutableMap<String,String> flagMacros){
  CxxPlatform.Builder builder=CxxPlatform.builder();
  final Archiver arDelegate=ar instanceof LazyDelegatingArchiver ? ((LazyDelegatingArchiver)ar).getDelegate() : ar;
  builder.setFlavor(flavor).setAs(config.getCompilerProvider("String_Node_Str").orElse(as)).setAspp(config.getPreprocessorProvider("String_Node_Str").orElse(aspp)).setCc(config.getCompilerProvider("String_Node_Str").orElse(cc)).setCxx(config.getCompilerProvider("String_Node_Str").orElse(cxx)).setCpp(config.getPreprocessorProvider("String_Node_Str").orElse(cpp)).setCxxpp(config.getPreprocessorProvider("String_Node_Str").orElse(cxxpp)).setCuda(config.getCompilerProvider("String_Node_Str")).setCudapp(config.getPreprocessorProvider("String_Node_Str")).setAsm(config.getCompilerProvider("String_Node_Str")).setAsmpp(config.getPreprocessorProvider("String_Node_Str")).setLd(config.getLinkerProvider("String_Node_Str",ld.getType()).orElse(ld)).addAllLdflags(ldFlags).setAr(new LazyDelegatingArchiver(() -> getTool("String_Node_Str",config).map(getArchiver(arDelegate.getClass(),config)::apply).orElse(arDelegate))).setRanlib(new LazyDelegatingTool(() -> getTool("String_Node_Str",config).orElse(ranlib))).setStrip(getTool("String_Node_Str",config).orElse(strip)).setSharedLibraryExtension(sharedLibraryExtension).setSharedLibraryVersionedExtensionFormat(sharedLibraryVersionedExtensionFormat).setStaticLibraryExtension(staticLibraryExtension).setObjectFileExtension(objectFileExtension).setCompilerDebugPathSanitizer(compilerDebugPathSanitizer.orElse(new MungingDebugPathSanitizer(config.getDebugPathSanitizerLimit(),File.separatorChar,Paths.get("String_Node_Str"),ImmutableBiMap.of()))).setAssemblerDebugPathSanitizer(assemblerDebugPathSanitizer.orElse(new MungingDebugPathSanitizer(config.getDebugPathSanitizerLimit(),File.separatorChar,Paths.get("String_Node_Str"),ImmutableBiMap.of()))).setFlagMacros(flagMacros);
  builder.setSymbolNameTool(new LazyDelegatingSymbolNameTool(() -> {
    Optional<Tool> configNm=getTool("String_Node_Str",config);
    if (configNm.isPresent()) {
      return new PosixNmSymbolNameTool(configNm.get());
    }
 else {
      return nm;
    }
  }
));
  builder.addAllCflags(cflags);
  builder.addAllCxxflags(cflags);
  builder.addAllCppflags(cppflags);
  builder.addAllCxxppflags(cppflags);
  builder.addAllAsflags(asflags);
  builder.addAllAsppflags(asppflags);
  CxxPlatforms.addToolFlagsFromConfig(config,builder);
  return builder.build();
}

Fixed version (ground truth):
public static CxxPlatform build(Flavor flavor,final CxxBuckConfig config,CompilerProvider as,PreprocessorProvider aspp,CompilerProvider cc,CompilerProvider cxx,PreprocessorProvider cpp,PreprocessorProvider cxxpp,LinkerProvider ld,Iterable<String> ldFlags,Tool strip,final Archiver ar,final Tool ranlib,final SymbolNameTool nm,ImmutableList<String> asflags,ImmutableList<String> asppflags,ImmutableList<String> cflags,ImmutableList<String> cppflags,String sharedLibraryExtension,String sharedLibraryVersionedExtensionFormat,String staticLibraryExtension,String objectFileExtension,DebugPathSanitizer compilerDebugPathSanitizer,DebugPathSanitizer assemblerDebugPathSanitizer,ImmutableMap<String,String> flagMacros){
  CxxPlatform.Builder builder=CxxPlatform.builder();
  final Archiver arDelegate=ar instanceof LazyDelegatingArchiver ? ((LazyDelegatingArchiver)ar).getDelegate() : ar;
  builder.setFlavor(flavor).setAs(config.getCompilerProvider("String_Node_Str").orElse(as)).setAspp(config.getPreprocessorProvider("String_Node_Str").orElse(aspp)).setCc(config.getCompilerProvider("String_Node_Str").orElse(cc)).setCxx(config.getCompilerProvider("String_Node_Str").orElse(cxx)).setCpp(config.getPreprocessorProvider("String_Node_Str").orElse(cpp)).setCxxpp(config.getPreprocessorProvider("String_Node_Str").orElse(cxxpp)).setCuda(config.getCompilerProvider("String_Node_Str")).setCudapp(config.getPreprocessorProvider("String_Node_Str")).setAsm(config.getCompilerProvider("String_Node_Str")).setAsmpp(config.getPreprocessorProvider("String_Node_Str")).setLd(config.getLinkerProvider("String_Node_Str",ld.getType()).orElse(ld)).addAllLdflags(ldFlags).setAr(new LazyDelegatingArchiver(() -> getTool("String_Node_Str",config).map(getArchiver(arDelegate.getClass(),config)::apply).orElse(arDelegate))).setRanlib(new LazyDelegatingTool(() -> getTool("String_Node_Str",config).orElse(ranlib))).setStrip(getTool("String_Node_Str",config).orElse(strip)).setSharedLibraryExtension(sharedLibraryExtension).setSharedLibraryVersionedExtensionFormat(sharedLibraryVersionedExtensionFormat).setStaticLibraryExtension(staticLibraryExtension).setObjectFileExtension(objectFileExtension).setCompilerDebugPathSanitizer(compilerDebugPathSanitizer).setAssemblerDebugPathSanitizer(assemblerDebugPathSanitizer).setFlagMacros(flagMacros);
  builder.setSymbolNameTool(new LazyDelegatingSymbolNameTool(() -> {
    Optional<Tool> configNm=getTool("String_Node_Str",config);
    if (configNm.isPresent()) {
      return new PosixNmSymbolNameTool(configNm.get());
    }
 else {
      return nm;
    }
  }
));
  builder.addAllCflags(cflags);
  builder.addAllCxxflags(cflags);
  builder.addAllCppflags(cppflags);
  builder.addAllCxxppflags(cppflags);
  builder.addAllAsflags(asflags);
  builder.addAllAsppflags(asppflags);
  CxxPlatforms.addToolFlagsFromConfig(config,builder);
  return builder.build();
}