From e3cd509b9ab074e031a4baaff3c8c9796d0747ff Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 27 May 2013 10:09:51 -0400 Subject: [PATCH] More tweaks to the mod sorting code --- fml/common/cpw/mods/fml/common/DummyModContainer.java | 7 ++++++- fml/common/cpw/mods/fml/common/toposort/ModSorter.java | 8 ++++---- .../cpw/mods/fml/common/toposort/TopologicalSort.java | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/DummyModContainer.java b/fml/common/cpw/mods/fml/common/DummyModContainer.java index 605c17138a..b68745abd0 100644 --- a/fml/common/cpw/mods/fml/common/DummyModContainer.java +++ b/fml/common/cpw/mods/fml/common/DummyModContainer.java @@ -28,12 +28,17 @@ public class DummyModContainer implements ModContainer { private ModMetadata md; private ArtifactVersion processedVersion; + private String label; public DummyModContainer(ModMetadata md) { this.md = md; } + public DummyModContainer(String label) + { + this.label = label; + } public DummyModContainer() { } @@ -161,6 +166,6 @@ public class DummyModContainer implements ModContainer @Override public String toString() { - return md != null ? getModId() :"Unknown Dummy Container @" + System.identityHashCode(this); + return md != null ? getModId() : "Dummy Container ("+label+") @" + System.identityHashCode(this); } } diff --git a/fml/common/cpw/mods/fml/common/toposort/ModSorter.java b/fml/common/cpw/mods/fml/common/toposort/ModSorter.java index 2d2f270bbf..bbdaa4e521 100644 --- a/fml/common/cpw/mods/fml/common/toposort/ModSorter.java +++ b/fml/common/cpw/mods/fml/common/toposort/ModSorter.java @@ -32,10 +32,10 @@ public class ModSorter { private DirectedGraph modGraph; - private ModContainer beforeAll = new DummyModContainer(); - private ModContainer afterAll = new DummyModContainer(); - private ModContainer before = new DummyModContainer(); - private ModContainer after = new DummyModContainer(); + private ModContainer beforeAll = new DummyModContainer("BeforeAll"); + private ModContainer afterAll = new DummyModContainer("AfterAll"); + private ModContainer before = new DummyModContainer("Before"); + private ModContainer after = new DummyModContainer("After"); public ModSorter(List modList, Map nameLookup) { diff --git a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java index 677c0dfde2..bf85f800cc 100644 --- a/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java +++ b/fml/common/cpw/mods/fml/common/toposort/TopologicalSort.java @@ -183,7 +183,7 @@ 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(expandedNodes, visitedNodes)); + 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); }