From 04f5fdb3d02c7fa29443ff7d6af847c8bddd0019 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 12 Mar 2022 22:00:35 +0800 Subject: Fix config loading. Message format fixes. --- src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java | 2 +- src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java b/src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java index a09fc05..362910c 100644 --- a/src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java +++ b/src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java @@ -36,7 +36,7 @@ public class GlobalConfigManager { public static void initializeGlobalManager(@NotNull File configFileDirectory) throws ConfigLoadException, IOException { Objects.requireNonNull(configFileDirectory); synchronized (lock) { - if (instance == null) { + if (instance != null) { throw new IllegalStateException("already initialized"); } instance = new GlobalConfigManager(configFileDirectory); diff --git a/src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java b/src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java index 9b0d012..a556f92 100644 --- a/src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java +++ b/src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java @@ -73,7 +73,7 @@ public final class PluginMain { rc.configure(messageRouter); // update routing table, clear endpoints logger.debug("Message router is configured successfully."); } catch (JsonProcessingException | ConfigSyntaxError ex) { - logger.error("Failed to load routing config", ex); + logger.error("Failed to load routing config.", ex); throw new RuntimeException(ex); } @@ -136,7 +136,7 @@ public final class PluginMain { try { GlobalConfigManager.initializeGlobalManager(environment.pluginDataPath().toFile()); } catch (ConfigLoadException | IOException ex) { - logger.error("Failed to load configuration", ex); + logger.error("Failed to load configuration.", ex); throw new RuntimeException(ex); } logger.info("Config files are loaded."); -- cgit v1.2.3