From ece6290c192b5e90cb3b26d5ba071c7bb16013f2 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 27 May 2013 09:25:50 -0400 Subject: [PATCH] Try and clean up cycle detection output a bit --- .../cpw/mods/fml/common/DummyModContainer.java | 8 +++++++- .../cpw/mods/fml/common/InjectedModContainer.java | 6 ++++++ .../mods/fml/common/toposort/TopologicalSort.java | 13 +++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/DummyModContainer.java b/fml/common/cpw/mods/fml/common/DummyModContainer.java index 5fc2fd807a..605c17138a 100644 --- a/fml/common/cpw/mods/fml/common/DummyModContainer.java +++ b/fml/common/cpw/mods/fml/common/DummyModContainer.java @@ -5,7 +5,7 @@ * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * + * * Contributors: * cpw - implementation */ @@ -157,4 +157,10 @@ public class DummyModContainer implements ModContainer { return null; } + + @Override + public String toString() + { + return md != null ? getModId() :"Unknown Dummy Container @" + System.identityHashCode(this); + } } diff --git a/fml/common/cpw/mods/fml/common/InjectedModContainer.java b/fml/common/cpw/mods/fml/common/InjectedModContainer.java index bc4f5017aa..d622db0083 100644 --- a/fml/common/cpw/mods/fml/common/InjectedModContainer.java +++ b/fml/common/cpw/mods/fml/common/InjectedModContainer.java @@ -148,4 +148,10 @@ public class InjectedModContainer implements ModContainer { return wrappedContainer.getSigningCertificate(); } + + @Override + public String toString() + { + return "Wrapped{"+wrappedContainer.toString()+"}"; + } } diff --git a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java index 4fb1d4a712..677c0dfde2 100644 --- a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java +++ b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java @@ -5,7 +5,7 @@ * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * + * * Contributors: * cpw - implementation */ @@ -25,6 +25,10 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; + /** * Topological sort for mod loading * @@ -174,7 +178,12 @@ public class TopologicalSort return; } - System.out.printf("%s: %s\n%s\n%s\n", node, sortedResult, visitedNodes, expandedNodes); + FMLLog.severe("Mod Sorting failed."); + FMLLog.severe("Visting node %s", node); + 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(expandedNodes, visitedNodes)); throw new ModSortingException("There was a cycle detected in the input graph, sorting is not possible", node, visitedNodes); }