Program: 111000
Project: 111000
Buggy source:
/** 
 * Given a list of   {@link Dependency} objects, returns a multimap from the {@link SkyKey} of thedependency to the  {@link Aspect} instances that should be merged into it.<p>Returns null if the required aspects are not computed yet.
 */
@Nullable private static ListMultimap<SkyKey,Aspect> resolveAspectDependencies(Environment env,Map<SkyKey,ConfiguredTarget> configuredTargetMap,Iterable<Dependency> deps,NestedSetBuilder<Package> transitivePackages) throws DependencyEvaluationException {
  ListMultimap<SkyKey,Aspect> result=ArrayListMultimap.create();
  Set<SkyKey> aspectKeys=new HashSet<>();
  for (  Dependency dep : deps) {
    for (    AspectWithParameters depAspect : dep.getAspects()) {
      aspectKeys.add(createAspectKey(dep.getLabel(),dep.getConfiguration(),depAspect));
    }
  }
  Map<SkyKey,ValueOrException3<AspectCreationException,NoSuchThingException,ConfiguredValueCreationException>> depAspects=env.getValuesOrThrow(aspectKeys,AspectCreationException.class,NoSuchThingException.class,ConfiguredValueCreationException.class);
  for (  Dependency dep : deps) {
    SkyKey depKey=TO_KEYS.apply(dep);
    if (result.containsKey(depKey)) {
      continue;
    }
    ConfiguredTarget depConfiguredTarget=configuredTargetMap.get(depKey);
    for (    AspectWithParameters depAspect : dep.getAspects()) {
      if (!aspectMatchesConfiguredTarget(depConfiguredTarget,depAspect.getAspectFactory())) {
        continue;
      }
      SkyKey aspectKey=createAspectKey(dep.getLabel(),dep.getConfiguration(),depAspect);
      AspectValue aspectValue=null;
      try {
        aspectValue=(AspectValue)depAspects.get(aspectKey).get();
      }
 catch (      ConfiguredValueCreationException e) {
        throw new IllegalStateException(e);
      }
catch (      NoSuchThingException|AspectCreationException e) {
        AspectFactory<?,?,?> depAspectFactory=AspectFactory.Util.create(depAspect.getAspectFactory());
        throw new DependencyEvaluationException(new ConfiguredValueCreationException(String.format("String_Node_Str",depAspectFactory.getDefinition().getName(),dep.getLabel(),e.toString())));
      }
      if (aspectValue == null) {
        return null;
      }
      result.put(depKey,aspectValue.getAspect());
      transitivePackages.addTransitive(aspectValue.getTransitivePackages());
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Given a list of   {@link Dependency} objects, returns a multimap from the {@link SkyKey} of thedependency to the  {@link Aspect} instances that should be merged into it.<p>Returns null if the required aspects are not computed yet.
 */
@Nullable private static ListMultimap<SkyKey,Aspect> resolveAspectDependencies(Environment env,Map<SkyKey,ConfiguredTarget> configuredTargetMap,Iterable<Dependency> deps,NestedSetBuilder<Package> transitivePackages) throws AspectCreationException {
  ListMultimap<SkyKey,Aspect> result=ArrayListMultimap.create();
  Set<SkyKey> aspectKeys=new HashSet<>();
  for (  Dependency dep : deps) {
    for (    AspectWithParameters depAspect : dep.getAspects()) {
      aspectKeys.add(createAspectKey(dep.getLabel(),dep.getConfiguration(),depAspect));
    }
  }
  Map<SkyKey,ValueOrException3<AspectCreationException,NoSuchThingException,ConfiguredValueCreationException>> depAspects=env.getValuesOrThrow(aspectKeys,AspectCreationException.class,NoSuchThingException.class,ConfiguredValueCreationException.class);
  for (  Dependency dep : deps) {
    SkyKey depKey=TO_KEYS.apply(dep);
    if (result.containsKey(depKey)) {
      continue;
    }
    ConfiguredTarget depConfiguredTarget=configuredTargetMap.get(depKey);
    for (    AspectWithParameters depAspect : dep.getAspects()) {
      if (!aspectMatchesConfiguredTarget(depConfiguredTarget,depAspect.getAspectFactory())) {
        continue;
      }
      SkyKey aspectKey=createAspectKey(dep.getLabel(),dep.getConfiguration(),depAspect);
      AspectValue aspectValue=null;
      try {
        aspectValue=(AspectValue)depAspects.get(aspectKey).get();
      }
 catch (      ConfiguredValueCreationException e) {
        throw new IllegalStateException(e);
      }
catch (      NoSuchThingException e) {
        AspectFactory<?,?,?> depAspectFactory=AspectFactory.Util.create(depAspect.getAspectFactory());
        throw new AspectCreationException(String.format("String_Node_Str",depAspectFactory.getDefinition().getName(),dep.getLabel(),e.toString()));
      }
      if (aspectValue == null) {
        return null;
      }
      result.put(depKey,aspectValue.getAspect());
      transitivePackages.addTransitive(aspectValue.getTransitivePackages());
    }
  }
  return result;
}