Program: 110546
Project: 110546
Buggy source:
/** 
 * Skylark API for shrinking a resource APK <p>TODO(b/79159379): Stop passing SkylarkRuleContext here
 * @param ctx the SkylarkRuleContext. We will soon change to using an ActionConstructionContextinstead. See b/79159379
 */
@SkylarkCallable(name="String_Node_Str",mandatoryPositionals=4,parameters={@Param(name="String_Node_Str",type=BinaryDataSettings.class,noneable=true,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",positional=false,defaultValue="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str")},doc="String_Node_Str" + "String_Node_Str") public AndroidBinaryDataInfo shrinkDataApk(SkylarkRuleContext ctx,AndroidBinaryDataInfo binaryDataInfo,Artifact proguardOutputJar,Artifact proguardMapping,Object maybeSettings,SkylarkList<ConfiguredTarget> deps,SkylarkList<ConfiguredTarget> localProguardSpecs,SkylarkList<ConfiguredTarget> extraProguardSpecs) throws EvalException, InterruptedException {
  BinaryDataSettings settings=fromNoneableOrDefault(maybeSettings,BinaryDataSettings.class,defaultBinaryDataSettings(ctx));
  if (!settings.shrinkResources) {
    return binaryDataInfo;
  }
  ImmutableList<Artifact> proguardSpecs=AndroidBinary.getProguardSpecs(ctx.getRuleContext(),getAndroidSemantics(),binaryDataInfo.getResourceProguardConfig(),binaryDataInfo.getManifestInfo().getManifest(),filesFromConfiguredTargets(localProguardSpecs),filesFromConfiguredTargets(extraProguardSpecs),getProviders(deps,ProguardSpecProvider.class));
  if (!binaryDataInfo.getResourcesInfo().getDirectAndroidResources().isSingleton()) {
    throw new EvalException(Location.BUILTIN,"String_Node_Str");
  }
  Optional<Artifact> maybeShrunkApk=AndroidBinary.maybeShrinkResources(ctx.getRuleContext(),binaryDataInfo.getResourcesInfo().getDirectAndroidResources().toList().get(0),ResourceDependencies.fromProviders(getProviders(deps,AndroidResourcesInfo.PROVIDER),false),proguardSpecs,proguardOutputJar,proguardMapping,settings.aaptVersion,settings.resourceFilterFactory,settings.noCompressExtensions);
  return maybeShrunkApk.map(binaryDataInfo::withShrunkApk).orElse(binaryDataInfo);
}

Fixed version (ground truth):
/** 
 * Skylark API for shrinking a resource APK <p>TODO(b/79159379): Stop passing SkylarkRuleContext here
 * @param ctx the SkylarkRuleContext. We will soon change to using an ActionConstructionContextinstead. See b/79159379
 */
@SkylarkCallable(name="String_Node_Str",mandatoryPositionals=4,parameters={@Param(name="String_Node_Str",type=BinaryDataSettings.class,noneable=true,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",positional=false,defaultValue="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str"),@Param(name="String_Node_Str",type=SkylarkList.class,generic1=ConfiguredTarget.class,defaultValue="String_Node_Str",positional=false,named=true,doc="String_Node_Str" + "String_Node_Str")},doc="String_Node_Str" + "String_Node_Str") public AndroidBinaryDataInfo shrinkDataApk(SkylarkRuleContext ctx,AndroidBinaryDataInfo binaryDataInfo,Artifact proguardOutputJar,Artifact proguardMapping,Object maybeSettings,SkylarkList<ConfiguredTarget> deps,SkylarkList<ConfiguredTarget> localProguardSpecs,SkylarkList<ConfiguredTarget> extraProguardSpecs) throws EvalException, InterruptedException {
  BinaryDataSettings settings=fromNoneableOrDefault(maybeSettings,BinaryDataSettings.class,defaultBinaryDataSettings(ctx));
  if (!settings.shrinkResources) {
    return binaryDataInfo;
  }
  ImmutableList<Artifact> proguardSpecs=AndroidBinary.getProguardSpecs(ctx.getRuleContext(),getAndroidSemantics(),binaryDataInfo.getResourceProguardConfig(),binaryDataInfo.getManifestInfo().getManifest(),filesFromConfiguredTargets(localProguardSpecs),filesFromConfiguredTargets(extraProguardSpecs),getProviders(deps,ProguardSpecProvider.class));
  if (!binaryDataInfo.getResourcesInfo().getDirectAndroidResources().isSingleton()) {
    throw new EvalException(Location.BUILTIN,"String_Node_Str" + binaryDataInfo.getResourcesInfo().getDirectAndroidResources());
  }
  Optional<Artifact> maybeShrunkApk=AndroidBinary.maybeShrinkResources(ctx.getRuleContext(),binaryDataInfo.getResourcesInfo().getDirectAndroidResources().toList().get(0),ResourceDependencies.fromProviders(getProviders(deps,AndroidResourcesInfo.PROVIDER),false),proguardSpecs,proguardOutputJar,proguardMapping,settings.aaptVersion,settings.resourceFilterFactory,settings.noCompressExtensions);
  return maybeShrunkApk.map(binaryDataInfo::withShrunkApk).orElse(binaryDataInfo);
}