Program: 53144
Project: 53144
Buggy source:
@SuppressWarnings("String_Node_Str") private Optional<PBXTarget> generateProjectTarget(TargetNode<?> targetNode) throws IOException {
  Preconditions.checkState(isBuiltByCurrentProject(targetNode.getBuildTarget()),"String_Node_Str");
  Optional<PBXTarget> result=Optional.absent();
  if (targetNode.getType().equals(AppleLibraryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateAppleLibraryTarget(project,(TargetNode<AppleNativeTargetDescriptionArg>)targetNode,Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(CxxLibraryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateCxxLibraryTarget(project,(TargetNode<CxxLibraryDescription.Arg>)targetNode,ImmutableSet.<AppleResourceDescription.Arg>of(),ImmutableSet.<AppleAssetCatalogDescription.Arg>of(),Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(AppleBinaryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateAppleBinaryTarget(project,(TargetNode<AppleNativeTargetDescriptionArg>)targetNode));
  }
 else   if (targetNode.getType().equals(AppleBundleDescription.TYPE)) {
    TargetNode<AppleBundleDescription.Arg> bundleTargetNode=(TargetNode<AppleBundleDescription.Arg>)targetNode;
    result=Optional.<PBXTarget>of(generateAppleBundleTarget(project,bundleTargetNode,(TargetNode<AppleNativeTargetDescriptionArg>)Preconditions.checkNotNull(targetGraph.get(bundleTargetNode.getConstructorArg().binary)),Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(AppleTestDescription.TYPE)) {
    result=generateAppleTestTarget((TargetNode<AppleTestDescription.Arg>)targetNode);
  }
 else   if (targetNode.getType().equals(AppleResourceDescription.TYPE)) {
    checkAppleResourceTargetNodeReferencingValidContents((TargetNode<AppleResourceDescription.Arg>)targetNode);
  }
 else   if (targetNode.getType().equals(HalideLibraryDescription.TYPE)) {
    TargetNode<HalideLibraryDescription.Arg> halideTargetNode=(TargetNode<HalideLibraryDescription.Arg>)targetNode;
    BuildTarget buildTarget=targetNode.getBuildTarget();
    if (!HalideLibraryDescription.isHalideCompilerTarget(buildTarget)) {
      result=generateHalideLibraryTarget(project,halideTargetNode);
      requiredBuildTargetsBuilder.add(buildTarget);
    }
  }
  buckEventBus.post(ProjectGenerationEvent.processed());
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Optional<PBXTarget> generateProjectTarget(TargetNode<?> targetNode) throws IOException {
  Preconditions.checkState(isBuiltByCurrentProject(targetNode.getBuildTarget()),"String_Node_Str");
  Optional<PBXTarget> result=Optional.absent();
  if (targetNode.getType().equals(AppleLibraryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateAppleLibraryTarget(project,(TargetNode<AppleNativeTargetDescriptionArg>)targetNode,Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(CxxLibraryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateCxxLibraryTarget(project,(TargetNode<CxxLibraryDescription.Arg>)targetNode,ImmutableSet.<AppleResourceDescription.Arg>of(),ImmutableSet.<AppleAssetCatalogDescription.Arg>of(),Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(AppleBinaryDescription.TYPE)) {
    result=Optional.<PBXTarget>of(generateAppleBinaryTarget(project,(TargetNode<AppleNativeTargetDescriptionArg>)targetNode));
  }
 else   if (targetNode.getType().equals(AppleBundleDescription.TYPE)) {
    TargetNode<AppleBundleDescription.Arg> bundleTargetNode=(TargetNode<AppleBundleDescription.Arg>)targetNode;
    result=Optional.<PBXTarget>of(generateAppleBundleTarget(project,bundleTargetNode,(TargetNode<AppleNativeTargetDescriptionArg>)Preconditions.checkNotNull(targetGraph.get(bundleTargetNode.getConstructorArg().binary)),Optional.<TargetNode<AppleBundleDescription.Arg>>absent()));
  }
 else   if (targetNode.getType().equals(AppleTestDescription.TYPE)) {
    result=generateAppleTestTarget((TargetNode<AppleTestDescription.Arg>)targetNode);
  }
 else   if (targetNode.getType().equals(AppleResourceDescription.TYPE)) {
    checkAppleResourceTargetNodeReferencingValidContents((TargetNode<AppleResourceDescription.Arg>)targetNode);
  }
 else   if (targetNode.getType().equals(HalideLibraryDescription.TYPE)) {
    TargetNode<HalideLibraryDescription.Arg> halideTargetNode=(TargetNode<HalideLibraryDescription.Arg>)targetNode;
    BuildTarget buildTarget=targetNode.getBuildTarget();
    if (!HalideLibraryDescription.isHalideCompilerTarget(buildTarget)) {
      result=generateHalideLibraryTarget(project,halideTargetNode);
      requiredBuildTargetsBuilder.add(HalideLibraryDescription.createHalideCompilerBuildTarget(buildTarget));
      requiredBuildTargetsBuilder.add(buildTarget);
    }
  }
  buckEventBus.post(ProjectGenerationEvent.processed());
  return result;
}