Program: 178577
Project: 178577
Buggy source:
/** 
 * <p> </p>
 * @param manifest
 * @param resolvedFeature
 * @throws BuildException
 */
private void resolvePlugins(FeatureManifest manifest,ResolvedFeature resolvedFeature) throws BuildException {
  Map<BundleDescription,Plugin> map=new HashMap<BundleDescription,Plugin>();
  List<BundleDescription> bundleDescriptions=new LinkedList<BundleDescription>();
  for (  Plugin plugin : manifest.getPlugins()) {
    BundleDescription bundleDescription=this._state.getBundle(plugin.getId(),plugin.getVersion().equals(Version.emptyVersion) ? null : plugin.getVersion());
    if (bundleDescription == null) {
      throw new BuildException("String_Node_Str" + plugin.getId() + "String_Node_Str"+ plugin.getVersion()+ "String_Node_Str");
    }
    if (!bundleDescription.isResolved()) {
      String resolverErrors=TargetPlatformImpl.dumpResolverErrors(bundleDescription,true);
      String bundleInfo=TargetPlatformImpl.getBundleInfo(bundleDescription);
      throw new RuntimeException(String.format("String_Node_Str",bundleInfo,resolverErrors));
    }
    bundleDescriptions.add(bundleDescription);
    map.put(bundleDescription,plugin);
  }
  BundleDescription[] sortedbundleDescriptions=bundleDescriptions.toArray(new BundleDescription[0]);
  Object[][] cycles=this._state.getStateHelper().sortBundles(sortedbundleDescriptions);
  if ((cycles != null) && (cycles.length > 0)) {
    A4ELogging.warn("String_Node_Str");
    for (    Object[] cycle : cycles) {
      A4ELogging.warn(Arrays.asList(cycle).toString());
    }
  }
  List<Pair<Plugin,BundleDescription>> result=new LinkedList<Pair<Plugin,BundleDescription>>();
  for (  BundleDescription bundleDescription : sortedbundleDescriptions) {
    Pair<Plugin,BundleDescription> pair=new Pair<Plugin,BundleDescription>(map.get(bundleDescription),bundleDescription);
    result.add(pair);
  }
  resolvedFeature.setPluginToBundleDescptionList(result);
}

Fixed version (ground truth):
/** 
 * <p> </p>
 * @param manifest
 * @param resolvedFeature
 * @throws BuildException
 */
private void resolvePlugins(FeatureManifest manifest,ResolvedFeature resolvedFeature) throws BuildException {
  Map<BundleDescription,Plugin> map=new HashMap<BundleDescription,Plugin>();
  List<BundleDescription> bundleDescriptions=new LinkedList<BundleDescription>();
  for (  Plugin plugin : manifest.getPlugins()) {
    if (matches(plugin.getOperatingSystem(),plugin.getMachineArchitecture(),plugin.getWindowingSystem(),plugin.getLocale())) {
      BundleDescription bundleDescription=this._state.getBundle(plugin.getId(),plugin.getVersion().equals(Version.emptyVersion) ? null : plugin.getVersion());
      if (bundleDescription == null) {
        throw new BuildException("String_Node_Str" + plugin.getId() + "String_Node_Str"+ plugin.getVersion()+ "String_Node_Str");
      }
      if (!bundleDescription.isResolved()) {
        String resolverErrors=TargetPlatformImpl.dumpResolverErrors(bundleDescription,true);
        String bundleInfo=TargetPlatformImpl.getBundleInfo(bundleDescription);
        throw new RuntimeException(String.format("String_Node_Str",bundleInfo,resolverErrors));
      }
      bundleDescriptions.add(bundleDescription);
      map.put(bundleDescription,plugin);
    }
  }
  BundleDescription[] sortedbundleDescriptions=bundleDescriptions.toArray(new BundleDescription[0]);
  Object[][] cycles=this._state.getStateHelper().sortBundles(sortedbundleDescriptions);
  if ((cycles != null) && (cycles.length > 0)) {
    A4ELogging.warn("String_Node_Str");
    for (    Object[] cycle : cycles) {
      A4ELogging.warn(Arrays.asList(cycle).toString());
    }
  }
  List<Pair<Plugin,BundleDescription>> result=new LinkedList<Pair<Plugin,BundleDescription>>();
  for (  BundleDescription bundleDescription : sortedbundleDescriptions) {
    Pair<Plugin,BundleDescription> pair=new Pair<Plugin,BundleDescription>(map.get(bundleDescription),bundleDescription);
    result.add(pair);
  }
  resolvedFeature.setPluginToBundleDescptionList(result);
}