Program: 52896
Project: 52896
Buggy source:
public static CxxPlatform build(Platform platform,CxxBuckConfig config){
  String sharedLibraryExtension;
  String sharedLibraryVersionedExtensionFormat;
  String staticLibraryExtension;
  String objectFileExtension;
  Path defaultCFrontend;
  Path defaultCxxFrontend;
  Path defaultLinker;
  LinkerProvider.Type linkerType;
  Archiver archiver;
  DebugPathSanitizer compilerSanitizer;
  Optional<String> binaryExtension;
  ImmutableMap<String,String> env=config.getEnvironment();
  Optional<CxxToolProvider.Type> defaultToolType=Optional.empty();
  String ranlibCommand;
switch (platform) {
case LINUX:
    sharedLibraryExtension="String_Node_Str";
  sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.GNU;
archiver=new GnuArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of(),CxxToolProvider.Type.GCC);
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
case MACOS:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_OSX_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_OSX_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.DARWIN;
archiver=new BsdArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of(),CxxToolProvider.Type.CLANG);
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
case WINDOWS:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath(DEFAULT_WINDOWS_CXX_FRONTEND,Paths.get(DEFAULT_WINDOWS_CXX_FRONTEND),env);
defaultCxxFrontend=getExecutablePath(DEFAULT_WINDOWS_CXX_FRONTEND,Paths.get(DEFAULT_WINDOWS_CXX_FRONTEND),env);
defaultLinker=getExecutablePath(DEFAULT_WINDOWS_LINK,Paths.get(DEFAULT_WINDOWS_LINK),env);
linkerType=LinkerProvider.Type.WINDOWS;
archiver=new WindowsArchiver(new HashedFileTool(getExecutablePath(DEFAULT_WINDOWS_LIB,Paths.get(DEFAULT_WINDOWS_LIB),env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of(),CxxToolProvider.Type.WINDOWS);
binaryExtension=Optional.of("String_Node_Str");
defaultToolType=Optional.of(CxxToolProvider.Type.WINDOWS);
ranlibCommand=DEFAULT_WINDOWS_RANLIB;
break;
case FREEBSD:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.GNU;
archiver=new BsdArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of(),CxxToolProvider.Type.GCC);
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
default :
throw new RuntimeException(String.format("String_Node_Str",platform));
}
PreprocessorProvider aspp=new PreprocessorProvider(defaultCFrontend,defaultToolType);
CompilerProvider as=new CompilerProvider(defaultCFrontend,defaultToolType);
PreprocessorProvider cpp=new PreprocessorProvider(defaultCFrontend,defaultToolType);
CompilerProvider cc=new CompilerProvider(defaultCFrontend,defaultToolType);
PreprocessorProvider cxxpp=new PreprocessorProvider(defaultCxxFrontend,defaultToolType);
CompilerProvider cxx=new CompilerProvider(defaultCxxFrontend,defaultToolType);
return CxxPlatforms.build(FLAVOR,platform,config,as,aspp,cc,cxx,cpp,cxxpp,new DefaultLinkerProvider(linkerType,new ConstantToolProvider(new HashedFileTool(defaultLinker))),ImmutableList.of(),new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_STRIP,env)),archiver,new HashedFileTool(getExecutablePath(ranlibCommand,DEFAULT_RANLIB,env)),new PosixNmSymbolNameTool(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_NM,env))),ImmutableList.of(),ImmutableList.of(),ImmutableList.of(),ImmutableList.of(),sharedLibraryExtension,sharedLibraryVersionedExtensionFormat,staticLibraryExtension,objectFileExtension,compilerSanitizer,new MungingDebugPathSanitizer(config.getDebugPathSanitizerLimit(),File.separatorChar,Paths.get("String_Node_Str"),ImmutableBiMap.of()),ImmutableMap.of(),binaryExtension,config.getHeaderVerification());
}

Fixed version (ground truth):
public static CxxPlatform build(Platform platform,CxxBuckConfig config){
  String sharedLibraryExtension;
  String sharedLibraryVersionedExtensionFormat;
  String staticLibraryExtension;
  String objectFileExtension;
  Path defaultCFrontend;
  Path defaultCxxFrontend;
  Path defaultLinker;
  LinkerProvider.Type linkerType;
  Archiver archiver;
  DebugPathSanitizer compilerSanitizer;
  Optional<String> binaryExtension;
  ImmutableMap<String,String> env=config.getEnvironment();
  Optional<CxxToolProvider.Type> defaultToolType=Optional.empty();
  String ranlibCommand;
switch (platform) {
case LINUX:
    sharedLibraryExtension="String_Node_Str";
  sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.GNU;
archiver=new GnuArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of());
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
case MACOS:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_OSX_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_OSX_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.DARWIN;
archiver=new BsdArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of());
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
case WINDOWS:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath(DEFAULT_WINDOWS_CXX_FRONTEND,Paths.get(DEFAULT_WINDOWS_CXX_FRONTEND),env);
defaultCxxFrontend=getExecutablePath(DEFAULT_WINDOWS_CXX_FRONTEND,Paths.get(DEFAULT_WINDOWS_CXX_FRONTEND),env);
defaultLinker=getExecutablePath(DEFAULT_WINDOWS_LINK,Paths.get(DEFAULT_WINDOWS_LINK),env);
linkerType=LinkerProvider.Type.WINDOWS;
archiver=new WindowsArchiver(new HashedFileTool(getExecutablePath(DEFAULT_WINDOWS_LIB,Paths.get(DEFAULT_WINDOWS_LIB),env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of());
binaryExtension=Optional.of("String_Node_Str");
defaultToolType=Optional.of(CxxToolProvider.Type.WINDOWS);
ranlibCommand=DEFAULT_WINDOWS_RANLIB;
break;
case FREEBSD:
sharedLibraryExtension="String_Node_Str";
sharedLibraryVersionedExtensionFormat="String_Node_Str";
staticLibraryExtension="String_Node_Str";
objectFileExtension="String_Node_Str";
defaultCFrontend=getExecutablePath("String_Node_Str",DEFAULT_C_FRONTEND,env);
defaultCxxFrontend=getExecutablePath("String_Node_Str",DEFAULT_CXX_FRONTEND,env);
defaultLinker=defaultCxxFrontend;
linkerType=LinkerProvider.Type.GNU;
archiver=new BsdArchiver(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_AR,env)));
compilerSanitizer=new PrefixMapDebugPathSanitizer("String_Node_Str",ImmutableBiMap.of());
binaryExtension=Optional.empty();
ranlibCommand=DEFAULT_UNIX_RANLIB;
break;
default :
throw new RuntimeException(String.format("String_Node_Str",platform));
}
PreprocessorProvider aspp=new PreprocessorProvider(defaultCFrontend,defaultToolType);
CompilerProvider as=new CompilerProvider(defaultCFrontend,defaultToolType);
PreprocessorProvider cpp=new PreprocessorProvider(defaultCFrontend,defaultToolType);
CompilerProvider cc=new CompilerProvider(defaultCFrontend,defaultToolType);
PreprocessorProvider cxxpp=new PreprocessorProvider(defaultCxxFrontend,defaultToolType);
CompilerProvider cxx=new CompilerProvider(defaultCxxFrontend,defaultToolType);
return CxxPlatforms.build(FLAVOR,platform,config,as,aspp,cc,cxx,cpp,cxxpp,new DefaultLinkerProvider(linkerType,new ConstantToolProvider(new HashedFileTool(defaultLinker))),ImmutableList.of(),new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_STRIP,env)),archiver,new HashedFileTool(getExecutablePath(ranlibCommand,DEFAULT_RANLIB,env)),new PosixNmSymbolNameTool(new HashedFileTool(getExecutablePath("String_Node_Str",DEFAULT_NM,env))),ImmutableList.of(),ImmutableList.of(),ImmutableList.of(),ImmutableList.of(),sharedLibraryExtension,sharedLibraryVersionedExtensionFormat,staticLibraryExtension,objectFileExtension,compilerSanitizer,new MungingDebugPathSanitizer(config.getDebugPathSanitizerLimit(),File.separatorChar,Paths.get("String_Node_Str"),ImmutableBiMap.of()),ImmutableMap.of(),binaryExtension,config.getHeaderVerification());
}