Program: 51804
Project: 51804
Buggy source:
/** 
 * Sort the mods into a sorted list, using dependency information from the containers. The sorting is performed using a   {@link TopologicalSort}based on the pre- and post- dependency information provided by the mods.
 */
private void sortModList(){
  FMLLog.fine("String_Node_Str");
  try {
    BiMap<String,ArtifactVersion> modVersions=HashBiMap.create();
    for (    ModContainer mod : getActiveModList()) {
      modVersions.put(mod.getModId(),mod.getProcessedVersion());
    }
    for (    ModContainer mod : getActiveModList()) {
      Set<ArtifactVersion> missingMods=Sets.difference(mod.getRequirements(),modVersions.values());
      if (!missingMods.isEmpty()) {
        FMLLog.severe("String_Node_Str",mod.getModId(),mod.getName(),missingMods);
        throw new MissingModsException(missingMods);
      }
      ImmutableList<ArtifactVersion> allDeps=ImmutableList.<ArtifactVersion>builder().addAll(mod.getDependants()).addAll(mod.getDependencies()).build();
      for (      ArtifactVersion v : allDeps) {
        missingMods=Sets.newHashSet();
        if (modVersions.containsKey(v.getLabel())) {
          if (!v.containsVersion(modVersions.get(v.getLabel()))) {
            missingMods.add(v);
          }
        }
      }
      if (!missingMods.isEmpty()) {
        FMLLog.severe("String_Node_Str",mod.getModId(),mod.getName(),missingMods);
        throw new MissingModsException(missingMods);
      }
    }
    FMLLog.fine("String_Node_Str");
    ModSorter sorter=new ModSorter(getActiveModList(),namedMods);
    try {
      FMLLog.fine("String_Node_Str");
      mods=sorter.sort();
      FMLLog.fine("String_Node_Str");
    }
 catch (    ModSortingException sortException) {
      FMLLog.severe("String_Node_Str");
      FMLLog.severe("String_Node_Str",sortException.getExceptionData().getVisitedNodes());
      FMLLog.severe("String_Node_Str",sortException.getExceptionData().getFirstBadNode());
      FMLLog.log(Level.SEVERE,sortException,"String_Node_Str");
      throw new LoaderException(sortException);
    }
  }
  finally {
    FMLLog.fine("String_Node_Str");
    for (    ModContainer mod : getActiveModList()) {
      if (!mod.isImmutable()) {
        FMLLog.fine("String_Node_Str",mod.getModId(),mod.getName(),mod.getVersion(),mod.getSource().getName(),mod.getSortingRules());
      }
    }
    if (mods.size() == 0) {
      FMLLog.fine("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sort the mods into a sorted list, using dependency information from the containers. The sorting is performed using a   {@link TopologicalSort}based on the pre- and post- dependency information provided by the mods.
 */
private void sortModList(){
  FMLLog.fine("String_Node_Str");
  try {
    BiMap<String,ArtifactVersion> modVersions=HashBiMap.create();
    for (    ModContainer mod : getActiveModList()) {
      modVersions.put(mod.getModId(),mod.getProcessedVersion());
    }
    for (    ModContainer mod : getActiveModList()) {
      Map<String,ArtifactVersion> names=Maps.uniqueIndex(mod.getRequirements(),new Function<ArtifactVersion,String>(){
        public String apply(        ArtifactVersion v){
          return v.getLabel();
        }
      }
);
      Set<String> missingMods=Sets.difference(names.keySet(),modVersions.keySet());
      Set<ArtifactVersion> versionMissingMods=Sets.newHashSet();
      if (!missingMods.isEmpty()) {
        FMLLog.severe("String_Node_Str",mod.getModId(),mod.getName(),missingMods);
        for (        String modid : missingMods) {
          versionMissingMods.add(names.get(modid));
        }
        throw new MissingModsException(versionMissingMods);
      }
      ImmutableList<ArtifactVersion> allDeps=ImmutableList.<ArtifactVersion>builder().addAll(mod.getDependants()).addAll(mod.getDependencies()).build();
      for (      ArtifactVersion v : allDeps) {
        if (modVersions.containsKey(v.getLabel())) {
          if (!v.containsVersion(modVersions.get(v.getLabel()))) {
            versionMissingMods.add(v);
          }
        }
      }
      if (!versionMissingMods.isEmpty()) {
        FMLLog.severe("String_Node_Str",mod.getModId(),mod.getName(),missingMods);
        throw new MissingModsException(versionMissingMods);
      }
    }
    FMLLog.fine("String_Node_Str");
    ModSorter sorter=new ModSorter(getActiveModList(),namedMods);
    try {
      FMLLog.fine("String_Node_Str");
      List<ModContainer> sortedMods=sorter.sort();
      mods.removeAll(sortedMods);
      sortedMods.addAll(mods);
      mods=sortedMods;
      FMLLog.fine("String_Node_Str");
    }
 catch (    ModSortingException sortException) {
      FMLLog.severe("String_Node_Str");
      FMLLog.severe("String_Node_Str",sortException.getExceptionData().getVisitedNodes());
      FMLLog.severe("String_Node_Str",sortException.getExceptionData().getFirstBadNode());
      FMLLog.log(Level.SEVERE,sortException,"String_Node_Str");
      throw new LoaderException(sortException);
    }
  }
  finally {
    FMLLog.fine("String_Node_Str");
    for (    ModContainer mod : getActiveModList()) {
      if (!mod.isImmutable()) {
        FMLLog.fine("String_Node_Str",mod.getModId(),mod.getName(),mod.getVersion(),mod.getSource().getName(),mod.getSortingRules());
      }
    }
    if (mods.size() == 0) {
      FMLLog.fine("String_Node_Str");
    }
  }
}