Program: 53013
Project: 53013
Buggy source:
@VisibleForTesting static Builder createBuilder(BuckConfig config,ProjectFilesystem filesystem,ProcessExecutor processExecutor,AndroidDirectoryResolver androidDirectoryResolver) throws InterruptedException, IOException {
  Platform platform=Platform.detect();
  AndroidBuckConfig androidConfig=new AndroidBuckConfig(config,platform);
  Optional<String> ndkVersion=androidConfig.getNdkVersion();
  if (!ndkVersion.isPresent()) {
    ndkVersion=androidDirectoryResolver.getNdkVersion();
  }
  AppleConfig appleConfig=new AppleConfig(config);
  SwiftBuckConfig swiftBuckConfig=new SwiftBuckConfig(config);
  final ImmutableList<AppleCxxPlatform> appleCxxPlatforms=buildAppleCxxPlatforms(appleConfig.getAppleDeveloperDirectorySupplier(processExecutor),appleConfig.getExtraToolchainPaths(),appleConfig.getExtraPlatformPaths(),config,appleConfig,swiftBuckConfig,processExecutor);
  final FlavorDomain<AppleCxxPlatform> platformFlavorsToAppleCxxPlatforms=FlavorDomain.from("String_Node_Str",appleCxxPlatforms);
  ImmutableMap.Builder<Flavor,SwiftPlatform> swiftPlatforms=ImmutableMap.builder();
  for (  Flavor flavor : platformFlavorsToAppleCxxPlatforms.getFlavors()) {
    Optional<SwiftPlatform> swiftPlatformOptional=platformFlavorsToAppleCxxPlatforms.getValue(flavor).getSwiftPlatform();
    if (swiftPlatformOptional.isPresent()) {
      swiftPlatforms.put(flavor,swiftPlatformOptional.get());
    }
  }
  CxxBuckConfig cxxBuckConfig=new CxxBuckConfig(config);
  Optional<Path> ndkRoot=androidDirectoryResolver.getNdkOrAbsent();
  ImmutableMap.Builder<NdkCxxPlatforms.TargetCpuType,NdkCxxPlatform> ndkCxxPlatformsBuilder=ImmutableMap.builder();
  if (ndkRoot.isPresent()) {
    NdkCxxPlatformCompiler.Type compilerType=androidConfig.getNdkCompiler().orElse(NdkCxxPlatforms.DEFAULT_COMPILER_TYPE);
    String gccVersion=androidConfig.getNdkGccVersion().orElse(NdkCxxPlatforms.getDefaultGccVersionForNdk(ndkVersion));
    String clangVersion=androidConfig.getNdkClangVersion().orElse(NdkCxxPlatforms.getDefaultClangVersionForNdk(ndkVersion));
    String compilerVersion=compilerType == NdkCxxPlatformCompiler.Type.GCC ? gccVersion : clangVersion;
    NdkCxxPlatformCompiler compiler=NdkCxxPlatformCompiler.builder().setType(compilerType).setVersion(compilerVersion).setGccVersion(gccVersion).build();
    ndkCxxPlatformsBuilder.putAll(NdkCxxPlatforms.getPlatforms(cxxBuckConfig,filesystem,ndkRoot.get(),compiler,androidConfig.getNdkCxxRuntime().orElse(NdkCxxPlatforms.DEFAULT_CXX_RUNTIME),androidConfig.getNdkAppPlatform().orElse(NdkCxxPlatforms.DEFAULT_TARGET_APP_PLATFORM),androidConfig.getNdkCpuAbis().orElse(NdkCxxPlatforms.DEFAULT_CPU_ABIS),platform));
  }
  ImmutableMap<NdkCxxPlatforms.TargetCpuType,NdkCxxPlatform> ndkCxxPlatforms=ndkCxxPlatformsBuilder.build();
  ImmutableMap.Builder<Flavor,CxxPlatform> cxxSystemPlatformsBuilder=ImmutableMap.builder();
  for (  NdkCxxPlatform ndkCxxPlatform : ndkCxxPlatforms.values()) {
    cxxSystemPlatformsBuilder.put(ndkCxxPlatform.getCxxPlatform().getFlavor(),ndkCxxPlatform.getCxxPlatform());
  }
  for (  AppleCxxPlatform appleCxxPlatform : platformFlavorsToAppleCxxPlatforms.getValues()) {
    cxxSystemPlatformsBuilder.put(appleCxxPlatform.getCxxPlatform().getFlavor(),appleCxxPlatform.getCxxPlatform());
  }
  CxxPlatform defaultHostCxxPlatform=DefaultCxxPlatforms.build(platform,cxxBuckConfig);
  cxxSystemPlatformsBuilder.put(defaultHostCxxPlatform.getFlavor(),defaultHostCxxPlatform);
  ImmutableMap<Flavor,CxxPlatform> cxxSystemPlatformsMap=cxxSystemPlatformsBuilder.build();
  Flavor hostFlavor=CxxPlatforms.getHostFlavor();
  if (!cxxSystemPlatformsMap.containsKey(hostFlavor)) {
    cxxSystemPlatformsBuilder.put(hostFlavor,CxxPlatform.builder().from(defaultHostCxxPlatform).setFlavor(hostFlavor).build());
    cxxSystemPlatformsMap=cxxSystemPlatformsBuilder.build();
  }
  ImmutableList<ImmutableFlavor> possibleHostFlavors=CxxPlatforms.getAllPossibleHostFlavors();
  HashMap<Flavor,CxxPlatform> cxxOverridePlatformsMap=new HashMap<Flavor,CxxPlatform>(cxxSystemPlatformsMap);
  ImmutableSet<Flavor> cxxFlavors=CxxBuckConfig.getCxxFlavors(config);
  for (  Flavor flavor : cxxFlavors) {
    if (!cxxSystemPlatformsMap.containsKey(flavor)) {
      if (possibleHostFlavors.contains(flavor)) {
        continue;
      }
      LOG.warn("String_Node_Str" + flavor);
    }
    cxxOverridePlatformsMap.put(flavor,CxxPlatforms.copyPlatformWithFlavorAndConfig(cxxOverridePlatformsMap.get(flavor),new CxxBuckConfig(config,flavor),flavor));
  }
  hostFlavor=DefaultCxxPlatforms.FLAVOR;
  Optional<String> hostCxxPlatformOverride=cxxBuckConfig.getHostPlatform();
  if (hostCxxPlatformOverride.isPresent()) {
    Flavor overrideFlavor=ImmutableFlavor.of(hostCxxPlatformOverride.get());
    if (cxxOverridePlatformsMap.containsKey(overrideFlavor)) {
      hostFlavor=overrideFlavor;
    }
  }
  CxxPlatform hostCxxPlatform=CxxPlatform.builder().from(cxxOverridePlatformsMap.get(hostFlavor)).setFlavor(DefaultCxxPlatforms.FLAVOR).build();
  cxxOverridePlatformsMap.put(DefaultCxxPlatforms.FLAVOR,hostCxxPlatform);
  ImmutableMap<Flavor,CxxPlatform> cxxPlatformsMap=ImmutableMap.<Flavor,CxxPlatform>builder().putAll(cxxOverridePlatformsMap).build();
  ExecutableFinder executableFinder=new ExecutableFinder();
  FlavorDomain<CxxPlatform> cxxPlatforms=new FlavorDomain<>("String_Node_Str",cxxPlatformsMap);
  CxxPlatform defaultCxxPlatform=CxxPlatforms.getConfigDefaultCxxPlatform(cxxBuckConfig,cxxPlatformsMap,hostCxxPlatform);
  DBuckConfig dBuckConfig=new DBuckConfig(config);
  ReactNativeBuckConfig reactNativeBuckConfig=new ReactNativeBuckConfig(config);
  RustBuckConfig rustBuckConfig=new RustBuckConfig(config);
  GoBuckConfig goBuckConfig=new GoBuckConfig(config,processExecutor,cxxPlatforms);
  HalideBuckConfig halideBuckConfig=new HalideBuckConfig(config);
  ProGuardConfig proGuardConfig=new ProGuardConfig(config);
  PythonBuckConfig pyConfig=new PythonBuckConfig(config,executableFinder);
  ImmutableList<PythonPlatform> pythonPlatformsList=pyConfig.getPythonPlatforms(processExecutor);
  FlavorDomain<PythonPlatform> pythonPlatforms=FlavorDomain.from("String_Node_Str",pythonPlatformsList);
  PythonBinaryDescription pythonBinaryDescription=new PythonBinaryDescription(pyConfig,pythonPlatforms,cxxBuckConfig,defaultCxxPlatform,cxxPlatforms);
  Optional<Long> defaultTestRuleTimeoutMs=config.getLong("String_Node_Str","String_Node_Str");
  Downloader downloader;
  DownloadConfig downloadConfig=new DownloadConfig(config);
  if (downloadConfig.isDownloadAtRuntimeOk()) {
    downloader=StackedDownloader.createFromConfig(config,androidDirectoryResolver.getSdkOrAbsent());
  }
 else {
    downloader=new ExplodingDownloader();
  }
  Builder builder=builder();
  JavaBuckConfig javaConfig=config.getView(JavaBuckConfig.class);
  JavacOptions defaultJavacOptions=javaConfig.getDefaultJavacOptions();
  JavaOptions defaultJavaOptions=javaConfig.getDefaultJavaOptions();
  JavaOptions defaultJavaOptionsForTests=javaConfig.getDefaultJavaOptionsForTests();
  KotlinBuckConfig kotlinBuckConfig=new KotlinBuckConfig(config);
  ScalaBuckConfig scalaConfig=new ScalaBuckConfig(config);
  InferBuckConfig inferBuckConfig=new InferBuckConfig(config);
  LuaConfig luaConfig=new LuaBuckConfig(config,executableFinder);
  CxxBinaryDescription cxxBinaryDescription=new CxxBinaryDescription(cxxBuckConfig,inferBuckConfig,defaultCxxPlatform,cxxPlatforms);
  CxxLibraryDescription cxxLibraryDescription=new CxxLibraryDescription(cxxBuckConfig,defaultCxxPlatform,inferBuckConfig,cxxPlatforms);
  FlavorDomain<SwiftPlatform> platformFlavorsToSwiftPlatforms=new FlavorDomain<>("String_Node_Str",swiftPlatforms.build());
  SwiftLibraryDescription swiftLibraryDescription=new SwiftLibraryDescription(cxxBuckConfig,swiftBuckConfig,cxxPlatforms,platformFlavorsToSwiftPlatforms);
  builder.register(swiftLibraryDescription);
  CodeSignIdentityStore codeSignIdentityStore=appleConfig.useDryRunCodeSigning() ? CodeSignIdentityStore.fromIdentities(ImmutableList.of()) : CodeSignIdentityStore.fromSystem(processExecutor);
  ProvisioningProfileStore provisioningProfileStore=ProvisioningProfileStore.fromSearchPath(processExecutor,appleConfig.getProvisioningProfileReadCommand(),appleConfig.getProvisioningProfileSearchPath());
  AppleLibraryDescription appleLibraryDescription=new AppleLibraryDescription(cxxLibraryDescription,swiftLibraryDescription,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleLibraryDescription);
  PrebuiltAppleFrameworkDescription appleFrameworkDescription=new PrebuiltAppleFrameworkDescription();
  builder.register(appleFrameworkDescription);
  AppleBinaryDescription appleBinaryDescription=new AppleBinaryDescription(cxxBinaryDescription,swiftLibraryDescription,platformFlavorsToAppleCxxPlatforms,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleBinaryDescription);
  HaskellBuckConfig haskellBuckConfig=new HaskellBuckConfig(config,executableFinder);
  builder.register(new HaskellLibraryDescription(haskellBuckConfig,cxxBuckConfig,cxxPlatforms));
  builder.register(new HaskellBinaryDescription(haskellBuckConfig,cxxPlatforms,defaultCxxPlatform));
  builder.register(new HaskellPrebuiltLibraryDescription());
  ListeningExecutorService dxExecutorService=MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(javaConfig.getDxThreadCount().orElse(SmartDexingStep.determineOptimalThreadCount()),new CommandThreadFactory("String_Node_Str")));
  builder.register(new AndroidAarDescription(new AndroidManifestDescription(),cxxBuckConfig,ndkCxxPlatforms));
  builder.register(new AndroidBinaryDescription(defaultJavaOptions,defaultJavacOptions,proGuardConfig,ndkCxxPlatforms,dxExecutorService,cxxBuckConfig));
  builder.register(new AndroidBuildConfigDescription(defaultJavacOptions));
  builder.register(new AndroidInstrumentationApkDescription(proGuardConfig,defaultJavacOptions,ndkCxxPlatforms,dxExecutorService,cxxBuckConfig));
  builder.register(new AndroidInstrumentationTestDescription(defaultJavaOptions,defaultTestRuleTimeoutMs));
  builder.register(new AndroidLibraryDescription(defaultJavacOptions,new DefaultAndroidLibraryCompilerFactory(scalaConfig,kotlinBuckConfig)));
  builder.register(new AndroidManifestDescription());
  builder.register(new AndroidPrebuiltAarDescription(defaultJavacOptions));
  builder.register(new AndroidReactNativeLibraryDescription(reactNativeBuckConfig));
  builder.register(new AndroidResourceDescription(config.isGrayscaleImageProcessingEnabled()));
  builder.register(new ApkGenruleDescription());
  builder.register(new AppleAssetCatalogDescription());
  builder.register(new ApplePackageDescription(appleConfig,defaultCxxPlatform,platformFlavorsToAppleCxxPlatforms));
  AppleBundleDescription appleBundleDescription=new AppleBundleDescription(appleBinaryDescription,appleLibraryDescription,cxxPlatforms,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleBundleDescription);
  builder.register(new AppleResourceDescription());
  builder.register(new AppleTestDescription(appleConfig,appleLibraryDescription,cxxPlatforms,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig.getAppleDeveloperDirectorySupplierForTests(processExecutor),defaultTestRuleTimeoutMs));
  builder.register(new CoreDataModelDescription());
  builder.register(new CsharpLibraryDescription());
  builder.register(cxxBinaryDescription);
  builder.register(cxxLibraryDescription);
  builder.register(new CxxGenruleDescription(cxxPlatforms));
  builder.register(new CxxLuaExtensionDescription(luaConfig,cxxBuckConfig,cxxPlatforms));
  builder.register(new CxxPythonExtensionDescription(pythonPlatforms,cxxBuckConfig,cxxPlatforms));
  builder.register(new CxxTestDescription(cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,defaultTestRuleTimeoutMs));
  builder.register(new DBinaryDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform));
  builder.register(new DLibraryDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform));
  builder.register(new DTestDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform,defaultTestRuleTimeoutMs));
  builder.register(new ExportFileDescription());
  builder.register(new GenruleDescription());
  builder.register(new GenAidlDescription());
  builder.register(new GoBinaryDescription(goBuckConfig));
  builder.register(new GoLibraryDescription(goBuckConfig));
  builder.register(new GoTestDescription(goBuckConfig,defaultTestRuleTimeoutMs));
  builder.register(new GraphqlLibraryDescription());
  GroovyBuckConfig groovyBuckConfig=new GroovyBuckConfig(config);
  builder.register(new GroovyLibraryDescription(groovyBuckConfig,defaultJavacOptions));
  builder.register(new GroovyTestDescription(groovyBuckConfig,defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs));
  builder.register(new GwtBinaryDescription(defaultJavaOptions));
  builder.register(new HalideLibraryDescription(cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,halideBuckConfig));
  builder.register(new IosReactNativeLibraryDescription(reactNativeBuckConfig));
  builder.register(new JavaBinaryDescription(defaultJavaOptions,defaultJavacOptions,defaultCxxPlatform));
  builder.register(new JavaLibraryDescription(defaultJavacOptions));
  builder.register(new JavaTestDescription(defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new KeystoreDescription());
  builder.register(new KotlinLibraryDescription(kotlinBuckConfig));
  builder.register(new KotlinTestDescription(kotlinBuckConfig,defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs));
  builder.register(new LuaBinaryDescription(luaConfig,cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,pythonPlatforms));
  builder.register(new LuaLibraryDescription());
  builder.register(new NdkLibraryDescription(ndkVersion,ndkCxxPlatforms));
  OcamlBuckConfig ocamlBuckConfig=new OcamlBuckConfig(platform,config);
  builder.register(new OcamlBinaryDescription(ocamlBuckConfig));
  builder.register(new OcamlLibraryDescription(ocamlBuckConfig));
  builder.register(new PrebuiltCxxLibraryDescription(cxxBuckConfig,cxxPlatforms));
  builder.register(PrebuiltCxxLibraryGroupDescription.of());
  builder.register(new PrebuiltDotnetLibraryDescription());
  builder.register(new PrebuiltJarDescription());
  builder.register(new PrebuiltNativeLibraryDescription());
  builder.register(new PrebuiltOcamlLibraryDescription());
  builder.register(new PrebuiltPythonLibraryDescription());
  builder.register(new ProjectConfigDescription());
  builder.register(pythonBinaryDescription);
  builder.register(new PythonLibraryDescription());
  builder.register(new PythonTestDescription(pythonBinaryDescription,pyConfig,pythonPlatforms,cxxBuckConfig,defaultCxxPlatform,defaultTestRuleTimeoutMs,cxxPlatforms));
  builder.register(new RemoteFileDescription(downloader));
  builder.register(new RobolectricTestDescription(defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new RustBinaryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new RustLibraryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new RustTestDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new PrebuiltRustLibraryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new ScalaLibraryDescription(scalaConfig));
  builder.register(new ScalaTestDescription(scalaConfig,defaultJavaOptionsForTests,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new SceneKitAssetsDescription());
  builder.register(new ShBinaryDescription());
  builder.register(new ShTestDescription(defaultTestRuleTimeoutMs));
  ThriftBuckConfig thriftBuckConfig=new ThriftBuckConfig(config);
  builder.register(new ThriftLibraryDescription(thriftBuckConfig,ImmutableList.of(new ThriftJavaEnhancer(thriftBuckConfig,defaultJavacOptions),new ThriftCxxEnhancer(thriftBuckConfig,cxxLibraryDescription,false),new ThriftCxxEnhancer(thriftBuckConfig,cxxLibraryDescription,true),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.NORMAL),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.TWISTED),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.ASYNCIO))));
  builder.register(new WorkerToolDescription(config));
  builder.register(new XcodePostbuildScriptDescription());
  builder.register(new XcodePrebuildScriptDescription());
  builder.register(new XcodeWorkspaceConfigDescription());
  builder.register(new ZipFileDescription());
  builder.register(new TargetGroupDescription());
  builder.setCxxPlatforms(cxxPlatforms);
  builder.setDefaultCxxPlatform(defaultCxxPlatform);
  builder.register(VersionedAliasDescription.of());
  return builder;
}

Fixed version (ground truth):
@VisibleForTesting static Builder createBuilder(BuckConfig config,ProjectFilesystem filesystem,ProcessExecutor processExecutor,AndroidDirectoryResolver androidDirectoryResolver) throws InterruptedException, IOException {
  Platform platform=Platform.detect();
  AndroidBuckConfig androidConfig=new AndroidBuckConfig(config,platform);
  Optional<String> ndkVersion=androidConfig.getNdkVersion();
  if (!ndkVersion.isPresent()) {
    ndkVersion=androidDirectoryResolver.getNdkVersion();
  }
  AppleConfig appleConfig=new AppleConfig(config);
  SwiftBuckConfig swiftBuckConfig=new SwiftBuckConfig(config);
  final ImmutableList<AppleCxxPlatform> appleCxxPlatforms=buildAppleCxxPlatforms(filesystem,appleConfig.getAppleDeveloperDirectorySupplier(processExecutor),appleConfig.getExtraToolchainPaths(),appleConfig.getExtraPlatformPaths(),config,appleConfig,swiftBuckConfig,processExecutor);
  final FlavorDomain<AppleCxxPlatform> platformFlavorsToAppleCxxPlatforms=FlavorDomain.from("String_Node_Str",appleCxxPlatforms);
  ImmutableMap.Builder<Flavor,SwiftPlatform> swiftPlatforms=ImmutableMap.builder();
  for (  Flavor flavor : platformFlavorsToAppleCxxPlatforms.getFlavors()) {
    Optional<SwiftPlatform> swiftPlatformOptional=platformFlavorsToAppleCxxPlatforms.getValue(flavor).getSwiftPlatform();
    if (swiftPlatformOptional.isPresent()) {
      swiftPlatforms.put(flavor,swiftPlatformOptional.get());
    }
  }
  CxxBuckConfig cxxBuckConfig=new CxxBuckConfig(config);
  Optional<Path> ndkRoot=androidDirectoryResolver.getNdkOrAbsent();
  ImmutableMap.Builder<NdkCxxPlatforms.TargetCpuType,NdkCxxPlatform> ndkCxxPlatformsBuilder=ImmutableMap.builder();
  if (ndkRoot.isPresent()) {
    NdkCxxPlatformCompiler.Type compilerType=androidConfig.getNdkCompiler().orElse(NdkCxxPlatforms.DEFAULT_COMPILER_TYPE);
    String gccVersion=androidConfig.getNdkGccVersion().orElse(NdkCxxPlatforms.getDefaultGccVersionForNdk(ndkVersion));
    String clangVersion=androidConfig.getNdkClangVersion().orElse(NdkCxxPlatforms.getDefaultClangVersionForNdk(ndkVersion));
    String compilerVersion=compilerType == NdkCxxPlatformCompiler.Type.GCC ? gccVersion : clangVersion;
    NdkCxxPlatformCompiler compiler=NdkCxxPlatformCompiler.builder().setType(compilerType).setVersion(compilerVersion).setGccVersion(gccVersion).build();
    ndkCxxPlatformsBuilder.putAll(NdkCxxPlatforms.getPlatforms(cxxBuckConfig,filesystem,ndkRoot.get(),compiler,androidConfig.getNdkCxxRuntime().orElse(NdkCxxPlatforms.DEFAULT_CXX_RUNTIME),androidConfig.getNdkAppPlatform().orElse(NdkCxxPlatforms.DEFAULT_TARGET_APP_PLATFORM),androidConfig.getNdkCpuAbis().orElse(NdkCxxPlatforms.DEFAULT_CPU_ABIS),platform));
  }
  ImmutableMap<NdkCxxPlatforms.TargetCpuType,NdkCxxPlatform> ndkCxxPlatforms=ndkCxxPlatformsBuilder.build();
  ImmutableMap.Builder<Flavor,CxxPlatform> cxxSystemPlatformsBuilder=ImmutableMap.builder();
  for (  NdkCxxPlatform ndkCxxPlatform : ndkCxxPlatforms.values()) {
    cxxSystemPlatformsBuilder.put(ndkCxxPlatform.getCxxPlatform().getFlavor(),ndkCxxPlatform.getCxxPlatform());
  }
  for (  AppleCxxPlatform appleCxxPlatform : platformFlavorsToAppleCxxPlatforms.getValues()) {
    cxxSystemPlatformsBuilder.put(appleCxxPlatform.getCxxPlatform().getFlavor(),appleCxxPlatform.getCxxPlatform());
  }
  CxxPlatform defaultHostCxxPlatform=DefaultCxxPlatforms.build(platform,filesystem,cxxBuckConfig);
  cxxSystemPlatformsBuilder.put(defaultHostCxxPlatform.getFlavor(),defaultHostCxxPlatform);
  ImmutableMap<Flavor,CxxPlatform> cxxSystemPlatformsMap=cxxSystemPlatformsBuilder.build();
  Flavor hostFlavor=CxxPlatforms.getHostFlavor();
  if (!cxxSystemPlatformsMap.containsKey(hostFlavor)) {
    cxxSystemPlatformsBuilder.put(hostFlavor,CxxPlatform.builder().from(defaultHostCxxPlatform).setFlavor(hostFlavor).build());
    cxxSystemPlatformsMap=cxxSystemPlatformsBuilder.build();
  }
  ImmutableList<ImmutableFlavor> possibleHostFlavors=CxxPlatforms.getAllPossibleHostFlavors();
  HashMap<Flavor,CxxPlatform> cxxOverridePlatformsMap=new HashMap<Flavor,CxxPlatform>(cxxSystemPlatformsMap);
  ImmutableSet<Flavor> cxxFlavors=CxxBuckConfig.getCxxFlavors(config);
  for (  Flavor flavor : cxxFlavors) {
    if (!cxxSystemPlatformsMap.containsKey(flavor)) {
      if (possibleHostFlavors.contains(flavor)) {
        continue;
      }
      LOG.warn("String_Node_Str" + flavor);
    }
    cxxOverridePlatformsMap.put(flavor,CxxPlatforms.copyPlatformWithFlavorAndConfig(cxxOverridePlatformsMap.get(flavor),new CxxBuckConfig(config,flavor),flavor));
  }
  hostFlavor=DefaultCxxPlatforms.FLAVOR;
  Optional<String> hostCxxPlatformOverride=cxxBuckConfig.getHostPlatform();
  if (hostCxxPlatformOverride.isPresent()) {
    Flavor overrideFlavor=ImmutableFlavor.of(hostCxxPlatformOverride.get());
    if (cxxOverridePlatformsMap.containsKey(overrideFlavor)) {
      hostFlavor=overrideFlavor;
    }
  }
  CxxPlatform hostCxxPlatform=CxxPlatform.builder().from(cxxOverridePlatformsMap.get(hostFlavor)).setFlavor(DefaultCxxPlatforms.FLAVOR).build();
  cxxOverridePlatformsMap.put(DefaultCxxPlatforms.FLAVOR,hostCxxPlatform);
  ImmutableMap<Flavor,CxxPlatform> cxxPlatformsMap=ImmutableMap.<Flavor,CxxPlatform>builder().putAll(cxxOverridePlatformsMap).build();
  ExecutableFinder executableFinder=new ExecutableFinder();
  FlavorDomain<CxxPlatform> cxxPlatforms=new FlavorDomain<>("String_Node_Str",cxxPlatformsMap);
  CxxPlatform defaultCxxPlatform=CxxPlatforms.getConfigDefaultCxxPlatform(cxxBuckConfig,cxxPlatformsMap,hostCxxPlatform);
  DBuckConfig dBuckConfig=new DBuckConfig(config);
  ReactNativeBuckConfig reactNativeBuckConfig=new ReactNativeBuckConfig(config);
  RustBuckConfig rustBuckConfig=new RustBuckConfig(config);
  GoBuckConfig goBuckConfig=new GoBuckConfig(config,processExecutor,cxxPlatforms);
  HalideBuckConfig halideBuckConfig=new HalideBuckConfig(config);
  ProGuardConfig proGuardConfig=new ProGuardConfig(config);
  PythonBuckConfig pyConfig=new PythonBuckConfig(config,executableFinder);
  ImmutableList<PythonPlatform> pythonPlatformsList=pyConfig.getPythonPlatforms(processExecutor);
  FlavorDomain<PythonPlatform> pythonPlatforms=FlavorDomain.from("String_Node_Str",pythonPlatformsList);
  PythonBinaryDescription pythonBinaryDescription=new PythonBinaryDescription(pyConfig,pythonPlatforms,cxxBuckConfig,defaultCxxPlatform,cxxPlatforms);
  Optional<Long> defaultTestRuleTimeoutMs=config.getLong("String_Node_Str","String_Node_Str");
  Downloader downloader;
  DownloadConfig downloadConfig=new DownloadConfig(config);
  if (downloadConfig.isDownloadAtRuntimeOk()) {
    downloader=StackedDownloader.createFromConfig(config,androidDirectoryResolver.getSdkOrAbsent());
  }
 else {
    downloader=new ExplodingDownloader();
  }
  Builder builder=builder();
  JavaBuckConfig javaConfig=config.getView(JavaBuckConfig.class);
  JavacOptions defaultJavacOptions=javaConfig.getDefaultJavacOptions();
  JavaOptions defaultJavaOptions=javaConfig.getDefaultJavaOptions();
  JavaOptions defaultJavaOptionsForTests=javaConfig.getDefaultJavaOptionsForTests();
  KotlinBuckConfig kotlinBuckConfig=new KotlinBuckConfig(config);
  ScalaBuckConfig scalaConfig=new ScalaBuckConfig(config);
  InferBuckConfig inferBuckConfig=new InferBuckConfig(config);
  LuaConfig luaConfig=new LuaBuckConfig(config,executableFinder);
  CxxBinaryDescription cxxBinaryDescription=new CxxBinaryDescription(cxxBuckConfig,inferBuckConfig,defaultCxxPlatform,cxxPlatforms);
  CxxLibraryDescription cxxLibraryDescription=new CxxLibraryDescription(cxxBuckConfig,defaultCxxPlatform,inferBuckConfig,cxxPlatforms);
  FlavorDomain<SwiftPlatform> platformFlavorsToSwiftPlatforms=new FlavorDomain<>("String_Node_Str",swiftPlatforms.build());
  SwiftLibraryDescription swiftLibraryDescription=new SwiftLibraryDescription(cxxBuckConfig,swiftBuckConfig,cxxPlatforms,platformFlavorsToSwiftPlatforms);
  builder.register(swiftLibraryDescription);
  CodeSignIdentityStore codeSignIdentityStore=appleConfig.useDryRunCodeSigning() ? CodeSignIdentityStore.fromIdentities(ImmutableList.of()) : CodeSignIdentityStore.fromSystem(processExecutor);
  ProvisioningProfileStore provisioningProfileStore=ProvisioningProfileStore.fromSearchPath(processExecutor,appleConfig.getProvisioningProfileReadCommand(),appleConfig.getProvisioningProfileSearchPath());
  AppleLibraryDescription appleLibraryDescription=new AppleLibraryDescription(cxxLibraryDescription,swiftLibraryDescription,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleLibraryDescription);
  PrebuiltAppleFrameworkDescription appleFrameworkDescription=new PrebuiltAppleFrameworkDescription();
  builder.register(appleFrameworkDescription);
  AppleBinaryDescription appleBinaryDescription=new AppleBinaryDescription(cxxBinaryDescription,swiftLibraryDescription,platformFlavorsToAppleCxxPlatforms,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleBinaryDescription);
  HaskellBuckConfig haskellBuckConfig=new HaskellBuckConfig(config,executableFinder);
  builder.register(new HaskellLibraryDescription(haskellBuckConfig,cxxBuckConfig,cxxPlatforms));
  builder.register(new HaskellBinaryDescription(haskellBuckConfig,cxxPlatforms,defaultCxxPlatform));
  builder.register(new HaskellPrebuiltLibraryDescription());
  ListeningExecutorService dxExecutorService=MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(javaConfig.getDxThreadCount().orElse(SmartDexingStep.determineOptimalThreadCount()),new CommandThreadFactory("String_Node_Str")));
  builder.register(new AndroidAarDescription(new AndroidManifestDescription(),cxxBuckConfig,ndkCxxPlatforms));
  builder.register(new AndroidBinaryDescription(defaultJavaOptions,defaultJavacOptions,proGuardConfig,ndkCxxPlatforms,dxExecutorService,cxxBuckConfig));
  builder.register(new AndroidBuildConfigDescription(defaultJavacOptions));
  builder.register(new AndroidInstrumentationApkDescription(proGuardConfig,defaultJavacOptions,ndkCxxPlatforms,dxExecutorService,cxxBuckConfig));
  builder.register(new AndroidInstrumentationTestDescription(defaultJavaOptions,defaultTestRuleTimeoutMs));
  builder.register(new AndroidLibraryDescription(defaultJavacOptions,new DefaultAndroidLibraryCompilerFactory(scalaConfig,kotlinBuckConfig)));
  builder.register(new AndroidManifestDescription());
  builder.register(new AndroidPrebuiltAarDescription(defaultJavacOptions));
  builder.register(new AndroidReactNativeLibraryDescription(reactNativeBuckConfig));
  builder.register(new AndroidResourceDescription(config.isGrayscaleImageProcessingEnabled()));
  builder.register(new ApkGenruleDescription());
  builder.register(new AppleAssetCatalogDescription());
  builder.register(new ApplePackageDescription(appleConfig,defaultCxxPlatform,platformFlavorsToAppleCxxPlatforms));
  AppleBundleDescription appleBundleDescription=new AppleBundleDescription(appleBinaryDescription,appleLibraryDescription,cxxPlatforms,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig);
  builder.register(appleBundleDescription);
  builder.register(new AppleResourceDescription());
  builder.register(new AppleTestDescription(appleConfig,appleLibraryDescription,cxxPlatforms,platformFlavorsToAppleCxxPlatforms,defaultCxxPlatform,codeSignIdentityStore,provisioningProfileStore,appleConfig.getAppleDeveloperDirectorySupplierForTests(processExecutor),defaultTestRuleTimeoutMs));
  builder.register(new CoreDataModelDescription());
  builder.register(new CsharpLibraryDescription());
  builder.register(cxxBinaryDescription);
  builder.register(cxxLibraryDescription);
  builder.register(new CxxGenruleDescription(cxxPlatforms));
  builder.register(new CxxLuaExtensionDescription(luaConfig,cxxBuckConfig,cxxPlatforms));
  builder.register(new CxxPythonExtensionDescription(pythonPlatforms,cxxBuckConfig,cxxPlatforms));
  builder.register(new CxxTestDescription(cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,defaultTestRuleTimeoutMs));
  builder.register(new DBinaryDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform));
  builder.register(new DLibraryDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform));
  builder.register(new DTestDescription(dBuckConfig,cxxBuckConfig,defaultCxxPlatform,defaultTestRuleTimeoutMs));
  builder.register(new ExportFileDescription());
  builder.register(new GenruleDescription());
  builder.register(new GenAidlDescription());
  builder.register(new GoBinaryDescription(goBuckConfig));
  builder.register(new GoLibraryDescription(goBuckConfig));
  builder.register(new GoTestDescription(goBuckConfig,defaultTestRuleTimeoutMs));
  builder.register(new GraphqlLibraryDescription());
  GroovyBuckConfig groovyBuckConfig=new GroovyBuckConfig(config);
  builder.register(new GroovyLibraryDescription(groovyBuckConfig,defaultJavacOptions));
  builder.register(new GroovyTestDescription(groovyBuckConfig,defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs));
  builder.register(new GwtBinaryDescription(defaultJavaOptions));
  builder.register(new HalideLibraryDescription(cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,halideBuckConfig));
  builder.register(new IosReactNativeLibraryDescription(reactNativeBuckConfig));
  builder.register(new JavaBinaryDescription(defaultJavaOptions,defaultJavacOptions,defaultCxxPlatform));
  builder.register(new JavaLibraryDescription(defaultJavacOptions));
  builder.register(new JavaTestDescription(defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new KeystoreDescription());
  builder.register(new KotlinLibraryDescription(kotlinBuckConfig));
  builder.register(new KotlinTestDescription(kotlinBuckConfig,defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs));
  builder.register(new LuaBinaryDescription(luaConfig,cxxBuckConfig,defaultCxxPlatform,cxxPlatforms,pythonPlatforms));
  builder.register(new LuaLibraryDescription());
  builder.register(new NdkLibraryDescription(ndkVersion,ndkCxxPlatforms));
  OcamlBuckConfig ocamlBuckConfig=new OcamlBuckConfig(platform,filesystem,config);
  builder.register(new OcamlBinaryDescription(ocamlBuckConfig));
  builder.register(new OcamlLibraryDescription(ocamlBuckConfig));
  builder.register(new PrebuiltCxxLibraryDescription(cxxBuckConfig,cxxPlatforms));
  builder.register(PrebuiltCxxLibraryGroupDescription.of());
  builder.register(new PrebuiltDotnetLibraryDescription());
  builder.register(new PrebuiltJarDescription());
  builder.register(new PrebuiltNativeLibraryDescription());
  builder.register(new PrebuiltOcamlLibraryDescription());
  builder.register(new PrebuiltPythonLibraryDescription());
  builder.register(new ProjectConfigDescription());
  builder.register(pythonBinaryDescription);
  builder.register(new PythonLibraryDescription());
  builder.register(new PythonTestDescription(pythonBinaryDescription,pyConfig,pythonPlatforms,cxxBuckConfig,defaultCxxPlatform,defaultTestRuleTimeoutMs,cxxPlatforms));
  builder.register(new RemoteFileDescription(downloader));
  builder.register(new RobolectricTestDescription(defaultJavaOptionsForTests,defaultJavacOptions,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new RustBinaryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new RustLibraryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new RustTestDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new PrebuiltRustLibraryDescription(rustBuckConfig,defaultCxxPlatform));
  builder.register(new ScalaLibraryDescription(scalaConfig));
  builder.register(new ScalaTestDescription(scalaConfig,defaultJavaOptionsForTests,defaultTestRuleTimeoutMs,defaultCxxPlatform));
  builder.register(new SceneKitAssetsDescription());
  builder.register(new ShBinaryDescription());
  builder.register(new ShTestDescription(defaultTestRuleTimeoutMs));
  ThriftBuckConfig thriftBuckConfig=new ThriftBuckConfig(config);
  builder.register(new ThriftLibraryDescription(thriftBuckConfig,ImmutableList.of(new ThriftJavaEnhancer(thriftBuckConfig,defaultJavacOptions),new ThriftCxxEnhancer(thriftBuckConfig,cxxLibraryDescription,false),new ThriftCxxEnhancer(thriftBuckConfig,cxxLibraryDescription,true),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.NORMAL),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.TWISTED),new ThriftPythonEnhancer(thriftBuckConfig,ThriftPythonEnhancer.Type.ASYNCIO))));
  builder.register(new WorkerToolDescription(config));
  builder.register(new XcodePostbuildScriptDescription());
  builder.register(new XcodePrebuildScriptDescription());
  builder.register(new XcodeWorkspaceConfigDescription());
  builder.register(new ZipFileDescription());
  builder.register(new TargetGroupDescription());
  builder.setCxxPlatforms(cxxPlatforms);
  builder.setDefaultCxxPlatform(defaultCxxPlatform);
  builder.register(VersionedAliasDescription.of());
  return builder;
}