diff options
author | GJ <gjmcferrin@gmail.com> | 2014-01-21 10:47:18 -0800 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-01-30 21:44:36 -0700 |
commit | 855b5f8ae37130895457a22041a30a537a1488b2 (patch) | |
tree | 2e902c1614491e54357eda8b803dd839a84a0cfa /src/main/java/org | |
parent | 19521b7f1c570af427df5525419210e0808d35e3 (diff) | |
download | craftbukkit-855b5f8ae37130895457a22041a30a537a1488b2.tar craftbukkit-855b5f8ae37130895457a22041a30a537a1488b2.tar.gz craftbukkit-855b5f8ae37130895457a22041a30a537a1488b2.tar.lz craftbukkit-855b5f8ae37130895457a22041a30a537a1488b2.tar.xz craftbukkit-855b5f8ae37130895457a22041a30a537a1488b2.zip |
[Bleeding] Instantiate logger earlier in CraftServer. Fixes BUKKIT-4253.
Previously, if an error occurred during CraftServer initialization before the
logger was instantiated, it would cause an NPE and the server would never
finish loading properly. By instantiating the logger before attempting to
load anything else in CraftServer, we ensure that a logger will always be
available in the case of any errors.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index f3e52007..d27ab8c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -148,6 +148,7 @@ public final class CraftServer implements Server { private final String serverName = "CraftBukkit"; private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); + private final Logger logger = Logger.getLogger("Minecraft"); private final ServicesManager servicesManager = new SimpleServicesManager(); private final CraftScheduler scheduler = new CraftScheduler(); private final SimpleCommandMap commandMap = new SimpleCommandMap(this); @@ -176,7 +177,6 @@ public final class CraftServer implements Server { public CraftScoreboardManager scoreboardManager; public boolean playerCommandState; private boolean printSaveWarning; - private Logger logger; private CraftIconCache icon; private final class BooleanWrapper { @@ -189,7 +189,6 @@ public final class CraftServer implements Server { } public CraftServer(MinecraftServer console, PlayerList playerList) { - this.logger = Logger.getLogger("Minecraft"); this.console = console; this.playerList = (DedicatedPlayerList) playerList; this.serverVersion = CraftServer.class.getPackage().getImplementationVersion(); |