summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-03-12 22:00:35 +0800
committerKeuin <[email protected]>2022-03-12 22:00:35 +0800
commit04f5fdb3d02c7fa29443ff7d6af847c8bddd0019 (patch)
tree4fd1232f2f5c173bd951adf349c4de6901298489 /src/main/java/com/keuin
parentd80825733465db5ae45339c841041682e864cda3 (diff)
Fix config loading. Message format fixes.
Diffstat (limited to 'src/main/java/com/keuin')
-rw-r--r--src/main/java/com/keuin/crosslink/config/GlobalConfigManager.java2
-rw-r--r--src/main/java/com/keuin/crosslink/plugin/common/PluginMain.java4
2 files changed, 3 insertions, 3 deletions
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.");