Program: 110938
Project: 110938
Buggy source:
@Override @Nullable public BuildConfiguration createConfigurations(ConfigurationFactory configurationFactory,Cache<String,BuildConfiguration> cache,PackageProviderForConfigurations packageProvider,BuildOptions buildOptions,EventHandler errorEventListener,boolean performSanityCheck) throws InvalidConfigurationException {
  BuildConfiguration targetConfiguration=configurationFactory.getConfiguration(packageProvider,buildOptions,false,cache);
  if (targetConfiguration == null) {
    return null;
  }
  BuildConfiguration dataConfiguration=targetConfiguration;
  BuildConfiguration hostConfiguration=getHostConfigurationFromRequest(configurationFactory,packageProvider,dataConfiguration,buildOptions,cache);
  if (hostConfiguration == null) {
    return null;
  }
  ListMultimap<SplitTransition<?>,BuildConfiguration> splitTransitionsTable=ArrayListMultimap.create();
  for (  SplitTransition<BuildOptions> transition : buildOptions.getPotentialSplitTransitions()) {
    List<BuildOptions> splitOptionsList=transition.split(buildOptions);
    if (splitOptionsList.size() > 1 && targetConfiguration.useDynamicConfigurations()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (    BuildOptions splitOptions : splitOptionsList) {
      BuildConfiguration splitConfig=configurationFactory.getConfiguration(packageProvider,splitOptions,false,cache);
      splitTransitionsTable.put(transition,splitConfig);
    }
  }
  if (packageProvider.valuesMissing()) {
    return null;
  }
  Set<Label> reachableLabels=new HashSet<>();
  if (performSanityCheck) {
    for (    Label label : buildOptions.getAllLabels().values()) {
      try {
        collectTransitiveClosure(packageProvider,reachableLabels,label);
      }
 catch (      NoSuchThingException e) {
        throw new IllegalStateException(e);
      }
    }
    sanityCheckImplicitLabels(reachableLabels,targetConfiguration);
    sanityCheckImplicitLabels(reachableLabels,hostConfiguration);
  }
  BuildConfiguration result=setupTransitions(targetConfiguration,dataConfiguration,hostConfiguration,splitTransitionsTable);
  result.reportInvalidOptions(errorEventListener);
  return result;
}

Fixed version (ground truth):
@Override @Nullable public BuildConfiguration createConfigurations(ConfigurationFactory configurationFactory,Cache<String,BuildConfiguration> cache,PackageProviderForConfigurations packageProvider,BuildOptions buildOptions,EventHandler eventHandler,boolean performSanityCheck) throws InvalidConfigurationException {
  BuildConfiguration targetConfiguration=configurationFactory.getConfiguration(packageProvider,buildOptions,false,cache);
  if (targetConfiguration == null) {
    return null;
  }
  BuildConfiguration dataConfiguration=targetConfiguration;
  BuildConfiguration hostConfiguration=getHostConfigurationFromRequest(configurationFactory,packageProvider,dataConfiguration,buildOptions,cache);
  if (hostConfiguration == null) {
    return null;
  }
  ListMultimap<SplitTransition<?>,BuildConfiguration> splitTransitionsTable=ArrayListMultimap.create();
  for (  SplitTransition<BuildOptions> transition : buildOptions.getPotentialSplitTransitions()) {
    List<BuildOptions> splitOptionsList=transition.split(buildOptions);
    if (splitOptionsList.size() > 1 && targetConfiguration.useDynamicConfigurations()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (    BuildOptions splitOptions : splitOptionsList) {
      BuildConfiguration splitConfig=configurationFactory.getConfiguration(packageProvider,splitOptions,false,cache);
      splitTransitionsTable.put(transition,splitConfig);
    }
  }
  if (packageProvider.valuesMissing()) {
    return null;
  }
  Set<Label> reachableLabels=new HashSet<>();
  if (performSanityCheck) {
    for (    Map.Entry<String,Label> entry : buildOptions.getAllLabels().entries()) {
      Label label=entry.getValue();
      try {
        collectTransitiveClosure(packageProvider,reachableLabels,label);
      }
 catch (      NoSuchThingException e) {
        eventHandler.handle(Event.error(e.getMessage()));
        throw new InvalidConfigurationException(String.format("String_Node_Str",entry.getKey(),label));
      }
    }
    if (packageProvider.valuesMissing()) {
      return null;
    }
    sanityCheckImplicitLabels(reachableLabels,targetConfiguration);
    sanityCheckImplicitLabels(reachableLabels,hostConfiguration);
  }
  BuildConfiguration result=setupTransitions(targetConfiguration,dataConfiguration,hostConfiguration,splitTransitionsTable);
  result.reportInvalidOptions(eventHandler);
  return result;
}