Program: 110787
Project: 110787
Buggy source:
private ResourceApk createApk(RuleContext ruleContext,boolean isLibrary,ResourceDependencies resourceDeps,ResourceConfigurationFilter configurationFilters,List<String> uncompressedExtensions,boolean crunchPng,List<String> densities,boolean incremental,ResourceContainer maybeInlinedResourceContainer,LocalResourceContainer data,Artifact proguardCfg,@Nullable Artifact mainDexProguardCfg,Artifact manifestOut,Artifact mergedResources,Artifact dataBindingInfoZip,@Nullable Artifact featureOf,@Nullable Artifact featureAfter) throws InterruptedException {
  ResourceContainer resourceContainer=checkForInlinedResources(maybeInlinedResourceContainer,resourceDeps.getResources(),ruleContext);
  if (ruleContext.hasErrors()) {
    return null;
  }
  resourceContainer=resourceContainer.filter(configurationFilters);
  resourceDeps=resourceDeps.filter(configurationFilters);
  ResourceContainer processed;
  if (isLibrary && AndroidCommon.getAndroidConfig(ruleContext).useParallelResourceProcessing()) {
    Preconditions.checkArgument(!incremental);
    Artifact rJavaClassJar=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_CLASS_JAR);
    ResourceContainer parsed=new AndroidResourceParsingActionBuilder(ruleContext).setParse(data).withPrimary(resourceContainer).setOutput(resourceContainer.getSymbols()).build(ruleContext);
    ResourceContainer generated=new LibraryRGeneratorActionBuilder().setJavaPackage(resourceContainer.getJavaPackage()).withPrimary(parsed).withDependencies(resourceDeps).setClassJarOut(rJavaClassJar).build(ruleContext);
    ResourceContainer merged=new AndroidResourceMergingActionBuilder(ruleContext).setJavaPackage(generated.getJavaPackage()).withPrimary(generated).withDependencies(resourceDeps).setMergedResourcesOut(mergedResources).setManifestOut(manifestOut).setDataBindingInfoZip(dataBindingInfoZip).build(ruleContext);
    processed=new AndroidResourceValidatorActionBuilder(ruleContext).setJavaPackage(merged.getJavaPackage()).setDebug(ruleContext.getConfiguration().getCompilationMode() != CompilationMode.OPT).setMergedResources(mergedResources).withPrimary(merged).setSourceJarOut(merged.getJavaSourceJar()).setRTxtOut(merged.getRTxt()).build(ruleContext);
  }
 else {
    AndroidResourcesProcessorBuilder builder=new AndroidResourcesProcessorBuilder(ruleContext).setLibrary(isLibrary).setApkOut(resourceContainer.getApk()).setConfigurationFilters(configurationFilters).setUncompressedExtensions(uncompressedExtensions).setCrunchPng(crunchPng).setJavaPackage(resourceContainer.getJavaPackage()).setDebug(ruleContext.getConfiguration().getCompilationMode() != CompilationMode.OPT).setManifestOut(manifestOut).setMergedResourcesOut(mergedResources).withPrimary(resourceContainer).withDependencies(resourceDeps).setDensities(densities).setProguardOut(proguardCfg).setMainDexProguardOut(mainDexProguardCfg).setDataBindingInfoZip(dataBindingInfoZip).setApplicationId(manifestValues.get("String_Node_Str")).setVersionCode(manifestValues.get("String_Node_Str")).setVersionName(manifestValues.get("String_Node_Str"));
    builder.setFeatureOf(featureOf);
    builder.setFeatureAfter(featureAfter);
    if (!incremental) {
      builder.setRTxtOut(resourceContainer.getRTxt()).setSymbols(resourceContainer.getSymbols()).setSourceJarOut(resourceContainer.getJavaSourceJar());
    }
    processed=builder.build(ruleContext);
  }
  return new ResourceApk(resourceContainer.getApk(),processed.getJavaSourceJar(),processed.getJavaClassJar(),resourceDeps,processed,processed.getManifest(),proguardCfg,mainDexProguardCfg,false);
}

Fixed version (ground truth):
private ResourceApk createApk(RuleContext ruleContext,boolean isLibrary,ResourceDependencies resourceDeps,ResourceFilter resourceFilter,List<String> uncompressedExtensions,boolean crunchPng,boolean incremental,ResourceContainer maybeInlinedResourceContainer,LocalResourceContainer data,Artifact proguardCfg,@Nullable Artifact mainDexProguardCfg,Artifact manifestOut,Artifact mergedResources,Artifact dataBindingInfoZip,@Nullable Artifact featureOf,@Nullable Artifact featureAfter) throws InterruptedException {
  ResourceContainer resourceContainer=checkForInlinedResources(maybeInlinedResourceContainer,resourceDeps.getResources(),ruleContext);
  if (ruleContext.hasErrors()) {
    return null;
  }
  resourceContainer=resourceContainer.filter(resourceFilter);
  resourceDeps=resourceDeps.filter(resourceFilter);
  ResourceContainer processed;
  if (isLibrary && AndroidCommon.getAndroidConfig(ruleContext).useParallelResourceProcessing()) {
    Preconditions.checkArgument(!incremental);
    Artifact rJavaClassJar=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_CLASS_JAR);
    ResourceContainer parsed=new AndroidResourceParsingActionBuilder(ruleContext).setParse(data).withPrimary(resourceContainer).setOutput(resourceContainer.getSymbols()).build(ruleContext);
    ResourceContainer generated=new LibraryRGeneratorActionBuilder().setJavaPackage(resourceContainer.getJavaPackage()).withPrimary(parsed).withDependencies(resourceDeps).setClassJarOut(rJavaClassJar).build(ruleContext);
    ResourceContainer merged=new AndroidResourceMergingActionBuilder(ruleContext).setJavaPackage(generated.getJavaPackage()).withPrimary(generated).withDependencies(resourceDeps).setMergedResourcesOut(mergedResources).setManifestOut(manifestOut).setDataBindingInfoZip(dataBindingInfoZip).build(ruleContext);
    processed=new AndroidResourceValidatorActionBuilder(ruleContext).setJavaPackage(merged.getJavaPackage()).setDebug(ruleContext.getConfiguration().getCompilationMode() != CompilationMode.OPT).setMergedResources(mergedResources).withPrimary(merged).setSourceJarOut(merged.getJavaSourceJar()).setRTxtOut(merged.getRTxt()).build(ruleContext);
  }
 else {
    AndroidResourcesProcessorBuilder builder=new AndroidResourcesProcessorBuilder(ruleContext).setLibrary(isLibrary).setApkOut(resourceContainer.getApk()).setResourceFilter(resourceFilter).setUncompressedExtensions(uncompressedExtensions).setCrunchPng(crunchPng).setJavaPackage(resourceContainer.getJavaPackage()).setDebug(ruleContext.getConfiguration().getCompilationMode() != CompilationMode.OPT).setManifestOut(manifestOut).setMergedResourcesOut(mergedResources).withPrimary(resourceContainer).withDependencies(resourceDeps).setProguardOut(proguardCfg).setMainDexProguardOut(mainDexProguardCfg).setDataBindingInfoZip(dataBindingInfoZip).setApplicationId(manifestValues.get("String_Node_Str")).setVersionCode(manifestValues.get("String_Node_Str")).setVersionName(manifestValues.get("String_Node_Str"));
    builder.setFeatureOf(featureOf);
    builder.setFeatureAfter(featureAfter);
    if (!incremental) {
      builder.setRTxtOut(resourceContainer.getRTxt()).setSymbols(resourceContainer.getSymbols()).setSourceJarOut(resourceContainer.getJavaSourceJar());
    }
    processed=builder.build(ruleContext);
  }
  return new ResourceApk(resourceContainer.getApk(),processed.getJavaSourceJar(),processed.getJavaClassJar(),resourceDeps,processed,processed.getManifest(),proguardCfg,mainDexProguardCfg,false);
}