Program: 110834
Project: 110834
Buggy source:
/** 
 * Runs Jars in   {@link JavaRuntimeJarProvider} through desugaring action if flag is set and addsthe result to  {@code result}. Note that this cannot happen in a separate aspect because aspects don't see providers added by other aspects executed on the same target.
 */
private Function<Artifact,Artifact> desugarJarsIfRequested(ConfiguredTarget base,RuleContext ruleContext,ConfiguredAspect.Builder result){
  if (!getAndroidConfig(ruleContext).desugarJava8()) {
    return Functions.identity();
  }
  Map<Artifact,Artifact> newlyDesugared=new HashMap<>();
  if (JavaCommon.isNeverLink(ruleContext)) {
    result.addProvider(AndroidRuntimeJarProvider.NEVERLINK);
    return Functions.forMap(newlyDesugared);
  }
  AndroidRuntimeJarProvider.Builder desugaredJars=new AndroidRuntimeJarProvider.Builder().addTransitiveProviders(collectPrerequisites(ruleContext,AndroidRuntimeJarProvider.class));
  JavaRuntimeJarProvider jarProvider=base.getProvider(JavaRuntimeJarProvider.class);
  if (jarProvider != null) {
    NestedSet<Artifact> compileTimeClasspath=base.getProvider(JavaCompilationArgsProvider.class).getRecursiveJavaCompilationArgs().getCompileTimeJars();
    ImmutableList<Artifact> bootclasspath=getBootclasspath(base,ruleContext);
    for (    Artifact jar : jarProvider.getRuntimeJars()) {
      Artifact desugared=createDesugarAction(ruleContext,jar,bootclasspath,compileTimeClasspath);
      newlyDesugared.put(jar,desugared);
      desugaredJars.addDesugaredJar(jar,desugared);
    }
  }
  result.addProvider(desugaredJars.build());
  return Functions.forMap(newlyDesugared);
}

Fixed version (ground truth):
/** 
 * Runs Jars in   {@link JavaRuntimeJarProvider} through desugaring action if flag is set and addsthe result to  {@code result}. Note that this cannot happen in a separate aspect because aspects don't see providers added by other aspects executed on the same target.
 */
private Function<Artifact,Artifact> desugarJarsIfRequested(ConfiguredTarget base,RuleContext ruleContext,ConfiguredAspect.Builder result){
  if (!getAndroidConfig(ruleContext).desugarJava8()) {
    return Functions.identity();
  }
  Map<Artifact,Artifact> newlyDesugared=new HashMap<>();
  if (JavaCommon.isNeverLink(ruleContext)) {
    result.addProvider(AndroidRuntimeJarProvider.NEVERLINK);
    return Functions.forMap(newlyDesugared);
  }
  AndroidRuntimeJarProvider.Builder desugaredJars=new AndroidRuntimeJarProvider.Builder().addTransitiveProviders(collectPrerequisites(ruleContext,AndroidRuntimeJarProvider.class));
  JavaRuntimeJarProvider jarProvider=base.getProvider(JavaRuntimeJarProvider.class);
  if (jarProvider != null) {
    NestedSet<Artifact> compileTimeClasspath=base.getProvider(JavaCompilationArgsProvider.class).getRecursiveJavaCompilationArgs().getCompileTimeJars();
    ImmutableList<Artifact> bootclasspath=getBootclasspath(base,ruleContext);
    boolean basenameClash=checkBasenameClash(jarProvider.getRuntimeJars());
    for (    Artifact jar : jarProvider.getRuntimeJars()) {
      Artifact desugared=createDesugarAction(ruleContext,basenameClash,jar,bootclasspath,compileTimeClasspath);
      newlyDesugared.put(jar,desugared);
      desugaredJars.addDesugaredJar(jar,desugared);
    }
  }
  result.addProvider(desugaredJars.build());
  return Functions.forMap(newlyDesugared);
}