From 2a064ffdc744ab38414ce81d3e57494b8a371dc0 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 27 May 2013 11:03:23 -0400 Subject: [PATCH] Send the "suspect list", and print the suspect versions --- fml/client/cpw/mods/fml/client/GuiSortingProblem.java | 2 +- fml/common/cpw/mods/fml/common/Loader.java | 10 ++++++++-- .../cpw/mods/fml/common/toposort/TopologicalSort.java | 6 ++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/fml/client/cpw/mods/fml/client/GuiSortingProblem.java b/fml/client/cpw/mods/fml/client/GuiSortingProblem.java index 95517e4b9..ad15770cd 100644 --- a/fml/client/cpw/mods/fml/client/GuiSortingProblem.java +++ b/fml/client/cpw/mods/fml/client/GuiSortingProblem.java @@ -39,7 +39,7 @@ public class GuiSortingProblem extends GuiScreen { for (ModContainer mc : failedList.getVisitedNodes()) { offset+=10; - this.func_73732_a(this.field_73886_k, String.format("%s", mc.toString()), this.field_73880_f / 2, offset, 0xEEEEEE); + this.func_73732_a(this.field_73886_k, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.field_73880_f / 2, offset, 0xEEEEEE); } offset+=20; this.func_73732_a(this.field_73886_k, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_73880_f / 2, offset, 0xFFFFFF); diff --git a/fml/common/cpw/mods/fml/common/Loader.java b/fml/common/cpw/mods/fml/common/Loader.java index 76582f9eb..f3ca020c6 100644 --- a/fml/common/cpw/mods/fml/common/Loader.java +++ b/fml/common/cpw/mods/fml/common/Loader.java @@ -66,6 +66,7 @@ import cpw.mods.fml.common.modloader.BaseModProxy; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.toposort.ModSorter; import cpw.mods.fml.common.toposort.ModSortingException; +import cpw.mods.fml.common.toposort.ModSortingException.SortingExceptionData; import cpw.mods.fml.common.toposort.TopologicalSort; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.VersionParser; @@ -269,8 +270,13 @@ public class Loader catch (ModSortingException sortException) { FMLLog.severe("A dependency cycle was detected in the input mod set so an ordering cannot be determined"); - FMLLog.severe("The suspect mod list is %s", sortException.getExceptionData().getVisitedNodes()); - FMLLog.severe("The first mod in the cycle is %s", sortException.getExceptionData().getFirstBadNode()); + SortingExceptionData exceptionData = sortException.getExceptionData(); + FMLLog.severe("The first mod in the cycle is %s", exceptionData.getFirstBadNode()); + FMLLog.severe("The mod cycle involves"); + for (ModContainer mc : exceptionData.getVisitedNodes()) + { + FMLLog.severe("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()); + } FMLLog.log(Level.SEVERE, sortException, "The full error"); throw sortException; } diff --git a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java index bf85f800c..8d3631f2f 100644 --- a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java +++ b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java @@ -26,6 +26,7 @@ import java.util.SortedSet; import java.util.TreeSet; import com.google.common.collect.Sets; +import com.google.common.collect.Sets.SetView; import cpw.mods.fml.common.FMLLog; @@ -183,8 +184,9 @@ public class TopologicalSort FMLLog.severe("Current sorted list : %s", sortedResult); FMLLog.severe("Visited set for this node : %s", visitedNodes); FMLLog.severe("Explored node set : %s", expandedNodes); - FMLLog.severe("Likely cycle is in : %s", Sets.difference(visitedNodes, expandedNodes)); - throw new ModSortingException("There was a cycle detected in the input graph, sorting is not possible", node, visitedNodes); + SetView cycleList = Sets.difference(visitedNodes, expandedNodes); + FMLLog.severe("Likely cycle is in : %s", cycleList); + throw new ModSortingException("There was a cycle detected in the input graph, sorting is not possible", node, cycleList); } // Visit this node