Program: 110982
Project: 110982
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 (    ConversionException e) {
      throw new AspectFunctionException(skyKey,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(skyKey,new BuildFileContainsErrorsException(key.getLabel().getPackageIdentifier()));
  }
  Target target;
  try {
    target=pkg.getTarget(key.getLabel().getName());
  }
 catch (  NoSuchTargetException e) {
    throw new AspectFunctionException(skyKey,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) {
    throw new AspectFunctionException(e.getRootCauseSkyKey(),e.getCause());
  }
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();
  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 (    SkylarkImportFailedException e) {
      throw new AspectFunctionException(skyKey,e);
    }
catch (    ConversionException e) {
      throw new AspectFunctionException(skyKey,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(skyKey,new BuildFileContainsErrorsException(key.getLabel().getPackageIdentifier()));
  }
  Target target;
  try {
    target=pkg.getTarget(key.getLabel().getName());
  }
 catch (  NoSuchTargetException e) {
    throw new AspectFunctionException(skyKey,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) {
    throw new AspectFunctionException(e.getRootCauseSkyKey(),e.getCause());
  }
catch (  AspectCreationException e) {
    throw new AspectFunctionException(e);
  }
}