Program: 110784
Project: 110784
Buggy source:
public ResourceContainer build(ActionConstructionContext context){
  List<Artifact> outs=new ArrayList<>();
  CustomCommandLine.Builder builder=new CustomCommandLine.Builder();
  builder.add("String_Node_Str").add("String_Node_Str").add("String_Node_Str");
  if (!Strings.isNullOrEmpty(sdk.getBuildToolsVersion())) {
    builder.add("String_Node_Str").add(sdk.getBuildToolsVersion());
  }
  builder.addExecPath("String_Node_Str",sdk.getAapt().getExecutable());
  NestedSetBuilder<Artifact> inputs=NestedSetBuilder.naiveLinkOrder();
  inputs.addAll(ruleContext.getExecutablePrerequisite("String_Node_Str",Mode.HOST).getRunfilesSupport().getRunfilesArtifactsWithoutMiddlemen());
  builder.addExecPath("String_Node_Str",sdk.getAnnotationsJar());
  inputs.add(sdk.getAnnotationsJar());
  builder.addExecPath("String_Node_Str",sdk.getAndroidJar());
  inputs.add(sdk.getAndroidJar());
  builder.add("String_Node_Str").add(RESOURCE_CONTAINER_TO_ARG.apply(primary));
  inputs.addTransitive(RESOURCE_CONTAINER_TO_ARTIFACTS.apply(primary));
  ResourceContainerConverter.convertDependencies(dependencies,builder,inputs,RESOURCE_DEP_TO_ARG,RESOURCE_DEP_TO_ARTIFACTS);
  if (isLibrary) {
    builder.add("String_Node_Str").add("String_Node_Str");
  }
  if (rTxtOut != null) {
    builder.addExecPath("String_Node_Str",rTxtOut);
    outs.add(rTxtOut);
  }
  if (symbols != null) {
    builder.addExecPath("String_Node_Str",symbols);
    outs.add(symbols);
  }
  if (sourceJarOut != null) {
    builder.addExecPath("String_Node_Str",sourceJarOut);
    outs.add(sourceJarOut);
  }
  if (proguardOut != null) {
    builder.addExecPath("String_Node_Str",proguardOut);
    outs.add(proguardOut);
  }
  if (mainDexProguardOut != null) {
    builder.addExecPath("String_Node_Str",mainDexProguardOut);
    outs.add(mainDexProguardOut);
  }
  if (manifestOut != null) {
    builder.addExecPath("String_Node_Str",manifestOut);
    outs.add(manifestOut);
  }
  if (mergedResourcesOut != null) {
    builder.addExecPath("String_Node_Str",mergedResourcesOut);
    outs.add(mergedResourcesOut);
  }
  if (apkOut != null) {
    builder.addExecPath("String_Node_Str",apkOut);
    outs.add(apkOut);
  }
  if (!resourceConfigs.isEmpty()) {
    builder.add("String_Node_Str").add(resourceConfigs.getFilterString());
  }
  if (!densities.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",densities);
  }
  if (!uncompressedExtensions.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",uncompressedExtensions);
  }
  if (!crunchPng) {
    builder.add("String_Node_Str");
  }
  if (!assetsToIgnore.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",assetsToIgnore);
  }
  if (debug) {
    builder.add("String_Node_Str");
  }
  if (versionCode != null) {
    builder.add("String_Node_Str").add(versionCode);
  }
  if (versionName != null) {
    builder.add("String_Node_Str").add(versionName);
  }
  if (applicationId != null) {
    builder.add("String_Node_Str").add(applicationId);
  }
  if (dataBindingInfoZip != null) {
    builder.addExecPath("String_Node_Str",dataBindingInfoZip);
    outs.add(dataBindingInfoZip);
  }
  if (!Strings.isNullOrEmpty(customJavaPackage)) {
    builder.add("String_Node_Str").add(customJavaPackage);
  }
  if (featureOf != null) {
    builder.addExecPath("String_Node_Str",featureOf);
    inputs.add(featureOf);
  }
  if (featureAfter != null) {
    builder.addExecPath("String_Node_Str",featureAfter);
    inputs.add(featureAfter);
  }
  ruleContext.registerAction(this.spawnActionBuilder.useParameterFile(ParameterFileType.UNQUOTED).addTool(sdk.getAapt()).addTransitiveInputs(inputs.build()).addOutputs(ImmutableList.<Artifact>copyOf(outs)).setCommandLine(builder.build()).setExecutable(ruleContext.getExecutablePrerequisite("String_Node_Str",Mode.HOST)).setProgressMessage("String_Node_Str" + ruleContext.getLabel()).setMnemonic("String_Node_Str").build(context));
  ResourceContainer.Builder result=primary.toBuilder().setJavaSourceJar(sourceJarOut).setRTxt(rTxtOut).setSymbols(symbols);
  if (apkOut != null) {
    result.setApk(apkOut);
  }
  if (manifestOut != null) {
    result.setManifest(manifestOut);
  }
  return result.build();
}

Fixed version (ground truth):
public ResourceContainer build(ActionConstructionContext context){
  List<Artifact> outs=new ArrayList<>();
  CustomCommandLine.Builder builder=new CustomCommandLine.Builder();
  builder.add("String_Node_Str").add("String_Node_Str").add("String_Node_Str");
  if (!Strings.isNullOrEmpty(sdk.getBuildToolsVersion())) {
    builder.add("String_Node_Str").add(sdk.getBuildToolsVersion());
  }
  builder.addExecPath("String_Node_Str",sdk.getAapt().getExecutable());
  NestedSetBuilder<Artifact> inputs=NestedSetBuilder.naiveLinkOrder();
  inputs.addAll(ruleContext.getExecutablePrerequisite("String_Node_Str",Mode.HOST).getRunfilesSupport().getRunfilesArtifactsWithoutMiddlemen());
  builder.addExecPath("String_Node_Str",sdk.getAnnotationsJar());
  inputs.add(sdk.getAnnotationsJar());
  builder.addExecPath("String_Node_Str",sdk.getAndroidJar());
  inputs.add(sdk.getAndroidJar());
  builder.add("String_Node_Str").add(RESOURCE_CONTAINER_TO_ARG.apply(primary));
  inputs.addTransitive(RESOURCE_CONTAINER_TO_ARTIFACTS.apply(primary));
  ResourceContainerConverter.convertDependencies(dependencies,builder,inputs,RESOURCE_DEP_TO_ARG,RESOURCE_DEP_TO_ARTIFACTS);
  if (isLibrary) {
    builder.add("String_Node_Str").add("String_Node_Str");
  }
  if (rTxtOut != null) {
    builder.addExecPath("String_Node_Str",rTxtOut);
    outs.add(rTxtOut);
  }
  if (symbols != null) {
    builder.addExecPath("String_Node_Str",symbols);
    outs.add(symbols);
  }
  if (sourceJarOut != null) {
    builder.addExecPath("String_Node_Str",sourceJarOut);
    outs.add(sourceJarOut);
  }
  if (proguardOut != null) {
    builder.addExecPath("String_Node_Str",proguardOut);
    outs.add(proguardOut);
  }
  if (mainDexProguardOut != null) {
    builder.addExecPath("String_Node_Str",mainDexProguardOut);
    outs.add(mainDexProguardOut);
  }
  if (manifestOut != null) {
    builder.addExecPath("String_Node_Str",manifestOut);
    outs.add(manifestOut);
  }
  if (mergedResourcesOut != null) {
    builder.addExecPath("String_Node_Str",mergedResourcesOut);
    outs.add(mergedResourcesOut);
  }
  if (apkOut != null) {
    builder.addExecPath("String_Node_Str",apkOut);
    outs.add(apkOut);
  }
  if (resourceFilter.hasConfigurationFilters() && !resourceFilter.isPrefiltering()) {
    builder.add("String_Node_Str").add(resourceFilter.getConfigurationFilterString());
  }
  if (resourceFilter.hasDensities() && !resourceFilter.isPrefiltering()) {
    builder.add("String_Node_Str").add(resourceFilter.getDensityString());
  }
  ImmutableList<String> filteredResources=resourceFilter.getFilteredResources();
  if (!filteredResources.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",filteredResources);
  }
  if (!uncompressedExtensions.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",uncompressedExtensions);
  }
  if (!crunchPng) {
    builder.add("String_Node_Str");
  }
  if (!assetsToIgnore.isEmpty()) {
    builder.addJoinStrings("String_Node_Str","String_Node_Str",assetsToIgnore);
  }
  if (debug) {
    builder.add("String_Node_Str");
  }
  if (versionCode != null) {
    builder.add("String_Node_Str").add(versionCode);
  }
  if (versionName != null) {
    builder.add("String_Node_Str").add(versionName);
  }
  if (applicationId != null) {
    builder.add("String_Node_Str").add(applicationId);
  }
  if (dataBindingInfoZip != null) {
    builder.addExecPath("String_Node_Str",dataBindingInfoZip);
    outs.add(dataBindingInfoZip);
  }
  if (!Strings.isNullOrEmpty(customJavaPackage)) {
    builder.add("String_Node_Str").add(customJavaPackage);
  }
  if (featureOf != null) {
    builder.addExecPath("String_Node_Str",featureOf);
    inputs.add(featureOf);
  }
  if (featureAfter != null) {
    builder.addExecPath("String_Node_Str",featureAfter);
    inputs.add(featureAfter);
  }
  ruleContext.registerAction(this.spawnActionBuilder.useParameterFile(ParameterFileType.UNQUOTED).addTool(sdk.getAapt()).addTransitiveInputs(inputs.build()).addOutputs(ImmutableList.<Artifact>copyOf(outs)).setCommandLine(builder.build()).setExecutable(ruleContext.getExecutablePrerequisite("String_Node_Str",Mode.HOST)).setProgressMessage("String_Node_Str" + ruleContext.getLabel()).setMnemonic("String_Node_Str").build(context));
  ResourceContainer.Builder result=primary.toBuilder().setJavaSourceJar(sourceJarOut).setRTxt(rTxtOut).setSymbols(symbols);
  if (apkOut != null) {
    result.setApk(apkOut);
  }
  if (manifestOut != null) {
    result.setManifest(manifestOut);
  }
  return result.build();
}