Program: 52936
Project: 52936
Buggy source:
/** 
 * @param targetGraph The target graph.
 * @param cellRoots The roots of known cells.
 * @param bundleLoader The binary in which the current library will be (dynamically) loaded into.
 */
public <A extends AppleNativeTargetDescriptionArg>BuildRule createLibraryBuildRule(TargetGraph targetGraph,BuildRuleParams params,BuildRuleResolver resolver,CellPathResolver cellRoots,A args,Optional<Linker.LinkableDepType> linkableDepType,Optional<SourcePath> bundleLoader,ImmutableSet<BuildTarget> blacklist,ImmutableSortedSet<BuildTarget> extraCxxDeps) throws NoSuchBuildTargetException {
  Optional<StripStyle> flavoredStripStyle=StripStyle.FLAVOR_DOMAIN.getValue(params.getBuildTarget());
  params=CxxStrip.removeStripStyleFlavorInParams(params,flavoredStripStyle);
  SourcePathResolver pathResolver=new SourcePathResolver(new SourcePathRuleFinder(resolver));
  BuildRule unstrippedBinaryRule=requireUnstrippedBuildRule(params,resolver,cellRoots,targetGraph,args,linkableDepType,bundleLoader,blacklist,pathResolver,extraCxxDeps);
  if (!shouldWrapIntoDebuggableBinary(params.getBuildTarget(),unstrippedBinaryRule)) {
    return unstrippedBinaryRule;
  }
  CxxPlatform representativePlatform=delegate.getCxxPlatforms().getValue(Iterables.getFirst(Sets.intersection(delegate.getCxxPlatforms().getFlavors(),params.getBuildTarget().getFlavors()),defaultCxxPlatform.getFlavor()));
  params=CxxStrip.restoreStripStyleFlavorInParams(params,flavoredStripStyle);
  BuildRule strippedBinaryRule=CxxDescriptionEnhancer.createCxxStripRule(params,resolver,flavoredStripStyle.orElse(StripStyle.NON_GLOBAL_SYMBOLS),unstrippedBinaryRule,representativePlatform);
  return AppleDescriptions.createAppleDebuggableBinary(params,resolver,strippedBinaryRule,(ProvidesLinkedBinaryDeps)unstrippedBinaryRule,AppleDebugFormat.FLAVOR_DOMAIN.getValue(params.getBuildTarget()).orElse(appleConfig.getDefaultDebugInfoFormatForLibraries()),delegate.getCxxPlatforms(),delegate.getDefaultCxxPlatform(),appleCxxPlatformFlavorDomain);
}

Fixed version (ground truth):
/** 
 * @param targetGraph The target graph.
 * @param cellRoots The roots of known cells.
 * @param bundleLoader The binary in which the current library will be (dynamically) loaded into.
 */
public <A extends AppleNativeTargetDescriptionArg>BuildRule createLibraryBuildRule(TargetGraph targetGraph,BuildRuleParams params,BuildRuleResolver resolver,CellPathResolver cellRoots,A args,Optional<Linker.LinkableDepType> linkableDepType,Optional<SourcePath> bundleLoader,ImmutableSet<BuildTarget> blacklist,ImmutableSortedSet<BuildTarget> extraCxxDeps,CxxLibraryDescription.TransitiveCxxPreprocessorInputFunction transitiveCxxPreprocessorInput) throws NoSuchBuildTargetException {
  Optional<StripStyle> flavoredStripStyle=StripStyle.FLAVOR_DOMAIN.getValue(params.getBuildTarget());
  params=CxxStrip.removeStripStyleFlavorInParams(params,flavoredStripStyle);
  SourcePathResolver pathResolver=new SourcePathResolver(new SourcePathRuleFinder(resolver));
  BuildRule unstrippedBinaryRule=requireUnstrippedBuildRule(params,resolver,cellRoots,targetGraph,args,linkableDepType,bundleLoader,blacklist,pathResolver,extraCxxDeps,transitiveCxxPreprocessorInput);
  if (!shouldWrapIntoDebuggableBinary(params.getBuildTarget(),unstrippedBinaryRule)) {
    return unstrippedBinaryRule;
  }
  CxxPlatform representativePlatform=delegate.getCxxPlatforms().getValue(Iterables.getFirst(Sets.intersection(delegate.getCxxPlatforms().getFlavors(),params.getBuildTarget().getFlavors()),defaultCxxPlatform.getFlavor()));
  params=CxxStrip.restoreStripStyleFlavorInParams(params,flavoredStripStyle);
  BuildRule strippedBinaryRule=CxxDescriptionEnhancer.createCxxStripRule(params,resolver,flavoredStripStyle.orElse(StripStyle.NON_GLOBAL_SYMBOLS),unstrippedBinaryRule,representativePlatform);
  return AppleDescriptions.createAppleDebuggableBinary(params,resolver,strippedBinaryRule,(ProvidesLinkedBinaryDeps)unstrippedBinaryRule,AppleDebugFormat.FLAVOR_DOMAIN.getValue(params.getBuildTarget()).orElse(appleConfig.getDefaultDebugInfoFormatForLibraries()),delegate.getCxxPlatforms(),delegate.getDefaultCxxPlatform(),appleCxxPlatformFlavorDomain);
}