Program: 110547
Project: 110547
Buggy source:
@Override public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException {
  androidMigrationSemantics.validateRuleContext(ruleContext);
  AndroidSdkProvider.verifyPresence(ruleContext);
  RuleConfiguredTargetBuilder ruleBuilder=new RuleConfiguredTargetBuilder(ruleContext);
  Artifact aar=ruleContext.getPrerequisiteArtifact("String_Node_Str",Mode.TARGET);
  Artifact allAarJars=createAarTreeArtifact(ruleContext,"String_Node_Str");
  Artifact jarMergingParams=createAarArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarEmbeddedJarsExtractorActions(ruleContext,aar,allAarJars,jarMergingParams));
  Artifact mergedJar=createAarArtifact(ruleContext,MERGED_JAR);
  ruleContext.registerAction(createAarJarsMergingActions(ruleContext,allAarJars,mergedJar,jarMergingParams));
  Artifact androidManifestArtifact=createAarArtifact(ruleContext,ANDROID_MANIFEST);
  SpecialArtifact resources=createAarTreeArtifact(ruleContext,"String_Node_Str");
  SpecialArtifact assets=createAarTreeArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarResourcesExtractorActions(ruleContext,aar,resources,assets));
  final ResourceApk resourceApk;
  if (AndroidResources.decoupleDataProcessing(ruleContext)) {
    StampedAndroidManifest manifest=AndroidManifest.forAarImport(ruleContext,androidManifestArtifact);
    boolean neverlink=JavaCommon.isNeverLink(ruleContext);
    ValidatedAndroidResources validatedResources=AndroidResources.forAarImport(resources).process(ruleContext,manifest,neverlink);
    MergedAndroidAssets mergedAssets=AndroidAssets.forAarImport(assets).process(ruleContext,neverlink);
    resourceApk=ResourceApk.of(validatedResources,mergedAssets);
  }
 else {
    ApplicationManifest androidManifest=ApplicationManifest.fromExplicitManifest(ruleContext,androidManifestArtifact);
    Artifact resourcesZip=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP);
    resourceApk=androidManifest.packAarWithDataAndResources(ruleContext,AndroidAssets.forAarImport(assets),AndroidResources.forAarImport(resources),ResourceDependencies.fromRuleDeps(ruleContext,JavaCommon.isNeverLink(ruleContext)),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_R_TXT),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_LOCAL_SYMBOLS),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST),resourcesZip);
  }
  NestedSet<Artifact> filesToBuild=NestedSetBuilder.<Artifact>stableOrder().add(resourceApk.getValidatedResources().getMergedResources()).add(mergedJar).build();
  Artifact nativeLibs=createAarArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarNativeLibsFilterActions(ruleContext,aar,nativeLibs));
  JavaRuleOutputJarsProvider.Builder jarProviderBuilder=new JavaRuleOutputJarsProvider.Builder().addOutputJar(mergedJar,null,ImmutableList.of());
  ImmutableList<TransitiveInfoCollection> targets=ImmutableList.<TransitiveInfoCollection>builder().addAll(ruleContext.getPrerequisites("String_Node_Str",Mode.TARGET)).addAll(ruleContext.getPrerequisites("String_Node_Str",Mode.TARGET)).build();
  JavaCommon common=new JavaCommon(ruleContext,javaSemantics,ImmutableList.of(),targets,targets,targets);
  javaSemantics.checkRule(ruleContext,common);
  common.setJavaCompilationArtifacts(new JavaCompilationArtifacts.Builder().addRuntimeJar(mergedJar).addCompileTimeJarAsFullJar(mergedJar).build());
  JavaCompilationArgsProvider javaCompilationArgsProvider=JavaCompilationArgsProvider.create(common.collectJavaCompilationArgs(false,JavaCommon.isNeverLink(ruleContext),false),common.collectJavaCompilationArgs(true,JavaCommon.isNeverLink(ruleContext),false));
  Artifact depsCheckerResult=null;
  JavaConfiguration javaConfig=ruleContext.getFragment(JavaConfiguration.class);
  if (javaConfig.getImportDepsCheckingLevel() != ImportDepsCheckingLevel.OFF) {
    NestedSet<Artifact> deps=getCompileTimeJarsFromCollection(targets,javaConfig.getImportDepsCheckingLevel() == ImportDepsCheckingLevel.STRICT_ERROR);
    NestedSet<Artifact> bootclasspath=getBootclasspath(ruleContext);
    depsCheckerResult=createAarArtifact(ruleContext,"String_Node_Str");
    ImportDepsCheckActionBuilder.newBuilder().bootcalsspath(bootclasspath).declareDeps(deps).checkJars(NestedSetBuilder.<Artifact>stableOrder().add(mergedJar).build()).outputArtifiact(depsCheckerResult).importDepsCheckingLevel(javaConfig.getImportDepsCheckingLevel()).buildAndRegister(ruleContext);
  }
  ruleContext.registerAction(createSingleFileExtractorActions(ruleContext,aar,ANDROID_MANIFEST,depsCheckerResult,androidManifestArtifact));
  JavaInfo.Builder javaInfoBuilder=JavaInfo.Builder.create().setRuntimeJars(ImmutableList.of(mergedJar)).setJavaConstraints(ImmutableList.of("String_Node_Str")).setNeverlink(JavaCommon.isNeverLink(ruleContext)).addProvider(JavaCompilationArgsProvider.class,javaCompilationArgsProvider).addProvider(JavaRuleOutputJarsProvider.class,jarProviderBuilder.build());
  common.addTransitiveInfoProviders(ruleBuilder,javaInfoBuilder,filesToBuild,null);
  resourceApk.addToConfiguredTargetBuilder(ruleBuilder,ruleContext.getLabel(),false);
  ruleBuilder.setFilesToBuild(filesToBuild).addSkylarkTransitiveInfo(JavaSkylarkApiProvider.NAME,JavaSkylarkApiProvider.fromRuleContext()).addProvider(RunfilesProvider.class,RunfilesProvider.EMPTY).addNativeDeclaredProvider(new AndroidNativeLibsInfo(AndroidCommon.collectTransitiveNativeLibs(ruleContext).add(nativeLibs).build())).addNativeDeclaredProvider(javaInfoBuilder.build());
  if (depsCheckerResult != null) {
    ruleBuilder.addOutputGroup(OutputGroupInfo.HIDDEN_TOP_LEVEL,depsCheckerResult);
  }
  return ruleBuilder.build();
}

Fixed version (ground truth):
@Override public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException {
  androidMigrationSemantics.validateRuleContext(ruleContext);
  AndroidSdkProvider.verifyPresence(ruleContext);
  RuleConfiguredTargetBuilder ruleBuilder=new RuleConfiguredTargetBuilder(ruleContext);
  Artifact aar=ruleContext.getPrerequisiteArtifact("String_Node_Str",Mode.TARGET);
  Artifact allAarJars=createAarTreeArtifact(ruleContext,"String_Node_Str");
  Artifact jarMergingParams=createAarArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarEmbeddedJarsExtractorActions(ruleContext,aar,allAarJars,jarMergingParams));
  Artifact mergedJar=createAarArtifact(ruleContext,MERGED_JAR);
  ruleContext.registerAction(createAarJarsMergingActions(ruleContext,allAarJars,mergedJar,jarMergingParams));
  Artifact androidManifestArtifact=createAarArtifact(ruleContext,ANDROID_MANIFEST);
  SpecialArtifact resources=createAarTreeArtifact(ruleContext,"String_Node_Str");
  SpecialArtifact assets=createAarTreeArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarResourcesExtractorActions(ruleContext,aar,resources,assets));
  final ResourceApk resourceApk;
  if (AndroidResources.decoupleDataProcessing(ruleContext)) {
    StampedAndroidManifest manifest=AndroidManifest.forAarImport(ruleContext,androidManifestArtifact);
    boolean neverlink=JavaCommon.isNeverLink(ruleContext);
    ValidatedAndroidResources validatedResources=AndroidResources.forAarImport(resources).process(ruleContext,manifest,neverlink);
    MergedAndroidAssets mergedAssets=AndroidAssets.forAarImport(assets).process(ruleContext,neverlink);
    resourceApk=ResourceApk.of(validatedResources,mergedAssets,null,null);
  }
 else {
    ApplicationManifest androidManifest=ApplicationManifest.fromExplicitManifest(ruleContext,androidManifestArtifact);
    Artifact resourcesZip=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP);
    resourceApk=androidManifest.packAarWithDataAndResources(ruleContext,AndroidAssets.forAarImport(assets),AndroidResources.forAarImport(resources),ResourceDependencies.fromRuleDeps(ruleContext,JavaCommon.isNeverLink(ruleContext)),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_R_TXT),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_LOCAL_SYMBOLS),ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST),resourcesZip);
  }
  NestedSet<Artifact> filesToBuild=NestedSetBuilder.<Artifact>stableOrder().add(resourceApk.getValidatedResources().getMergedResources()).add(mergedJar).build();
  Artifact nativeLibs=createAarArtifact(ruleContext,"String_Node_Str");
  ruleContext.registerAction(createAarNativeLibsFilterActions(ruleContext,aar,nativeLibs));
  JavaRuleOutputJarsProvider.Builder jarProviderBuilder=new JavaRuleOutputJarsProvider.Builder().addOutputJar(mergedJar,null,ImmutableList.of());
  ImmutableList<TransitiveInfoCollection> targets=ImmutableList.<TransitiveInfoCollection>builder().addAll(ruleContext.getPrerequisites("String_Node_Str",Mode.TARGET)).addAll(ruleContext.getPrerequisites("String_Node_Str",Mode.TARGET)).build();
  JavaCommon common=new JavaCommon(ruleContext,javaSemantics,ImmutableList.of(),targets,targets,targets);
  javaSemantics.checkRule(ruleContext,common);
  common.setJavaCompilationArtifacts(new JavaCompilationArtifacts.Builder().addRuntimeJar(mergedJar).addCompileTimeJarAsFullJar(mergedJar).build());
  JavaCompilationArgsProvider javaCompilationArgsProvider=JavaCompilationArgsProvider.create(common.collectJavaCompilationArgs(false,JavaCommon.isNeverLink(ruleContext),false),common.collectJavaCompilationArgs(true,JavaCommon.isNeverLink(ruleContext),false));
  Artifact depsCheckerResult=null;
  JavaConfiguration javaConfig=ruleContext.getFragment(JavaConfiguration.class);
  if (javaConfig.getImportDepsCheckingLevel() != ImportDepsCheckingLevel.OFF) {
    NestedSet<Artifact> deps=getCompileTimeJarsFromCollection(targets,javaConfig.getImportDepsCheckingLevel() == ImportDepsCheckingLevel.STRICT_ERROR);
    NestedSet<Artifact> bootclasspath=getBootclasspath(ruleContext);
    depsCheckerResult=createAarArtifact(ruleContext,"String_Node_Str");
    ImportDepsCheckActionBuilder.newBuilder().bootcalsspath(bootclasspath).declareDeps(deps).checkJars(NestedSetBuilder.<Artifact>stableOrder().add(mergedJar).build()).outputArtifiact(depsCheckerResult).importDepsCheckingLevel(javaConfig.getImportDepsCheckingLevel()).buildAndRegister(ruleContext);
  }
  ruleContext.registerAction(createSingleFileExtractorActions(ruleContext,aar,ANDROID_MANIFEST,depsCheckerResult,androidManifestArtifact));
  JavaInfo.Builder javaInfoBuilder=JavaInfo.Builder.create().setRuntimeJars(ImmutableList.of(mergedJar)).setJavaConstraints(ImmutableList.of("String_Node_Str")).setNeverlink(JavaCommon.isNeverLink(ruleContext)).addProvider(JavaCompilationArgsProvider.class,javaCompilationArgsProvider).addProvider(JavaRuleOutputJarsProvider.class,jarProviderBuilder.build());
  common.addTransitiveInfoProviders(ruleBuilder,javaInfoBuilder,filesToBuild,null);
  resourceApk.addToConfiguredTargetBuilder(ruleBuilder,ruleContext.getLabel(),false);
  ruleBuilder.setFilesToBuild(filesToBuild).addSkylarkTransitiveInfo(JavaSkylarkApiProvider.NAME,JavaSkylarkApiProvider.fromRuleContext()).addProvider(RunfilesProvider.class,RunfilesProvider.EMPTY).addNativeDeclaredProvider(new AndroidNativeLibsInfo(AndroidCommon.collectTransitiveNativeLibs(ruleContext).add(nativeLibs).build())).addNativeDeclaredProvider(javaInfoBuilder.build());
  if (depsCheckerResult != null) {
    ruleBuilder.addOutputGroup(OutputGroupInfo.HIDDEN_TOP_LEVEL,depsCheckerResult);
  }
  return ruleBuilder.build();
}