Program: 110979
Project: 110979
Buggy source:
@Nullable @Override public SkyValue compute(SkyKey skyKey,Environment env) throws AspectFunctionException, InterruptedException {
  SkyframeBuildView view=buildViewProvider.getSkyframeBuildView();
  NestedSetBuilder<Package> transitivePackages=NestedSetBuilder.stableOrder();
  AspectKey key=(AspectKey)skyKey.argument();
  ConfiguredAspectFactory aspectFactory;
  if (key.getAspectClass() instanceof NativeAspectClass<?>) {
    aspectFactory=(ConfiguredAspectFactory)((NativeAspectClass<?>)key.getAspectClass()).newInstance();
  }
 else   if (key.getAspectClass() instanceof SkylarkAspectClass) {
    SkylarkAspectClass skylarkAspectClass=(SkylarkAspectClass)key.getAspectClass();
    SkylarkAspect skylarkAspect;
    try {
      skylarkAspect=loadSkylarkAspect(env,skylarkAspectClass.getExtensionLabel(),skylarkAspectClass.getExportedName());
    }
 catch (    AspectCreationException e) {
      throw new AspectFunctionException(e);
    }
    if (skylarkAspect == null) {
      return null;
    }
    aspectFactory=new SkylarkAspectFactory(skylarkAspect.getName(),skylarkAspect);
  }
 else {
    throw new IllegalStateException();
  }
  PackageValue packageValue=(PackageValue)env.getValue(PackageValue.key(key.getLabel().getPackageIdentifier()));
  if (packageValue == null) {
    return null;
  }
  Package pkg=packageValue.getPackage();
  if (pkg.containsErrors()) {
    throw new AspectFunctionException(new BuildFileContainsErrorsException(key.getLabel().getPackageIdentifier()));
  }
  Target target;
  try {
    target=pkg.getTarget(key.getLabel().getName());
  }
 catch (  NoSuchTargetException e) {
    throw new AspectFunctionException(e);
  }
  if (!(target instanceof Rule)) {
    throw new AspectFunctionException(new AspectCreationException("String_Node_Str"));
  }
  final ConfiguredTargetValue configuredTargetValue=(ConfiguredTargetValue)env.getValue(ConfiguredTargetValue.key(key.getLabel(),key.getConfiguration()));
  if (configuredTargetValue == null) {
    return null;
  }
  RuleConfiguredTarget associatedTarget=(RuleConfiguredTarget)configuredTargetValue.getConfiguredTarget();
  if (associatedTarget == null) {
    return null;
  }
  SkyframeDependencyResolver resolver=view.createDependencyResolver(env);
  TargetAndConfiguration ctgValue=new TargetAndConfiguration(target,key.getConfiguration());
  try {
    Set<ConfigMatchingProvider> configConditions=ConfiguredTargetFunction.getConfigConditions(target,env,resolver,ctgValue,transitivePackages);
    if (configConditions == null) {
      return null;
    }
    ListMultimap<Attribute,ConfiguredTarget> depValueMap=ConfiguredTargetFunction.computeDependencies(env,resolver,ctgValue,key.getAspect(),configConditions,ruleClassProvider,view.getHostConfiguration(ctgValue.getConfiguration()),transitivePackages);
    return createAspect(env,key,aspectFactory,associatedTarget,configConditions,depValueMap,transitivePackages);
  }
 catch (  DependencyEvaluationException e) {
    if (e.getCause() instanceof ConfiguredValueCreationException) {
      ConfiguredValueCreationException cause=(ConfiguredValueCreationException)e.getCause();
      throw new AspectFunctionException(new AspectCreationException(cause.getMessage(),cause.getAnalysisRootCause()));
    }
 else {
      InvalidConfigurationException cause=(InvalidConfigurationException)e.getCause();
      throw new AspectFunctionException(new AspectCreationException(cause.getMessage()));
    }
  }
catch (  AspectCreationException e) {
    throw new AspectFunctionException(e);
  }
}

Fixed version (ground truth):
@Nullable @Override public SkyValue compute(SkyKey skyKey,Environment env) throws AspectFunctionException, InterruptedException {
  SkyframeBuildView view=buildViewProvider.getSkyframeBuildView();
  NestedSetBuilder<Package> transitivePackages=NestedSetBuilder.stableOrder();
  NestedSetBuilder<Label> transitiveRootCauses=NestedSetBuilder.stableOrder();
  AspectKey key=(AspectKey)skyKey.argument();
  ConfiguredAspectFactory aspectFactory;
  if (key.getAspectClass() instanceof NativeAspectClass<?>) {
    aspectFactory=(ConfiguredAspectFactory)((NativeAspectClass<?>)key.getAspectClass()).newInstance();
  }
 else   if (key.getAspectClass() instanceof SkylarkAspectClass) {
    SkylarkAspectClass skylarkAspectClass=(SkylarkAspectClass)key.getAspectClass();
    SkylarkAspect skylarkAspect;
    try {
      skylarkAspect=loadSkylarkAspect(env,skylarkAspectClass.getExtensionLabel(),skylarkAspectClass.getExportedName());
    }
 catch (    AspectCreationException e) {
      throw new AspectFunctionException(e);
    }
    if (skylarkAspect == null) {
      return null;
    }
    aspectFactory=new SkylarkAspectFactory(skylarkAspect.getName(),skylarkAspect);
  }
 else {
    throw new IllegalStateException();
  }
  PackageValue packageValue=(PackageValue)env.getValue(PackageValue.key(key.getLabel().getPackageIdentifier()));
  if (packageValue == null) {
    return null;
  }
  Package pkg=packageValue.getPackage();
  if (pkg.containsErrors()) {
    throw new AspectFunctionException(new BuildFileContainsErrorsException(key.getLabel().getPackageIdentifier()));
  }
  Target target;
  try {
    target=pkg.getTarget(key.getLabel().getName());
  }
 catch (  NoSuchTargetException e) {
    throw new AspectFunctionException(e);
  }
  if (!(target instanceof Rule)) {
    throw new AspectFunctionException(new AspectCreationException("String_Node_Str"));
  }
  final ConfiguredTargetValue configuredTargetValue;
  try {
    configuredTargetValue=(ConfiguredTargetValue)env.getValueOrThrow(ConfiguredTargetValue.key(key.getLabel(),key.getConfiguration()),ConfiguredValueCreationException.class);
  }
 catch (  ConfiguredValueCreationException e) {
    throw new AspectFunctionException(new AspectCreationException(e.getRootCauses()));
  }
  if (configuredTargetValue == null) {
    return null;
  }
  RuleConfiguredTarget associatedTarget=(RuleConfiguredTarget)configuredTargetValue.getConfiguredTarget();
  if (associatedTarget == null) {
    return null;
  }
  SkyframeDependencyResolver resolver=view.createDependencyResolver(env);
  TargetAndConfiguration ctgValue=new TargetAndConfiguration(target,key.getConfiguration());
  try {
    Set<ConfigMatchingProvider> configConditions=ConfiguredTargetFunction.getConfigConditions(target,env,resolver,ctgValue,transitivePackages,transitiveRootCauses);
    if (configConditions == null) {
      return null;
    }
    ListMultimap<Attribute,ConfiguredTarget> depValueMap=ConfiguredTargetFunction.computeDependencies(env,resolver,ctgValue,key.getAspect(),configConditions,ruleClassProvider,view.getHostConfiguration(ctgValue.getConfiguration()),transitivePackages,transitiveRootCauses);
    if (depValueMap == null) {
      return null;
    }
    if (!transitiveRootCauses.isEmpty()) {
      throw new AspectFunctionException(new AspectCreationException("String_Node_Str",transitiveRootCauses.build()));
    }
    return createAspect(env,key,aspectFactory,associatedTarget,configConditions,depValueMap,transitivePackages);
  }
 catch (  DependencyEvaluationException e) {
    if (e.getCause() instanceof ConfiguredValueCreationException) {
      ConfiguredValueCreationException cause=(ConfiguredValueCreationException)e.getCause();
      throw new AspectFunctionException(new AspectCreationException(cause.getMessage(),cause.getAnalysisRootCause()));
    }
 else {
      InvalidConfigurationException cause=(InvalidConfigurationException)e.getCause();
      throw new AspectFunctionException(new AspectCreationException(cause.getMessage()));
    }
  }
catch (  AspectCreationException e) {
    throw new AspectFunctionException(e);
  }
}