diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java index 00fa74436..41220c346 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigNode.java @@ -79,7 +79,7 @@ public class ConfigNode { } private String[] splitPathInTwo(String path) { - String[] split = StringUtils.split(path, "\\.", 2); + String[] split = StringUtils.split(path, ".", 2); if (split.length <= 1) { return new String[]{split[0], ""}; } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigReader.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigReader.java index 2d1325c59..ff19611fd 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigReader.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigReader.java @@ -17,13 +17,13 @@ package com.djrapitops.plan.system.settings.config; import com.djrapitops.plugin.utilities.Verify; -import org.apache.commons.lang3.StringUtils; import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Scanner; @@ -145,7 +145,9 @@ public class ConfigReader implements Closeable { private ConfigNode parseNode(String line) { // Parse a node "Key: value" - String[] keyAndValue = StringUtils.split(line, ":", 2); + // Can not use StringUtils.split(line, ":", 2) - Relies on 2nd empty String for parent node parsing + String[] keyAndValue = line.split(":", 2); + System.out.println(Arrays.toString(keyAndValue)); if (keyAndValue.length <= 1) { return handleMultiline(line); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigValueParser.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigValueParser.java index e5cb0d2f1..a14b9a136 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigValueParser.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigValueParser.java @@ -162,7 +162,7 @@ public interface ConfigValueParser { @Override public List compose(String fromValue) { List values = new ArrayList<>(); - for (String line : StringUtils.split(fromValue, "\\n")) { + for (String line : StringUtils.split(fromValue, "\n")) { if (line.trim().isEmpty()) { continue; } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigWriter.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigWriter.java index ec95179e4..9e32f7d4e 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigWriter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/config/ConfigWriter.java @@ -114,7 +114,7 @@ public class ConfigWriter { } else if (StringUtils.contains(value, "\n")) { // List values include newline characters, // see ConfigValueParser.StringListParser - addListValue(key, StringUtils.split(value, "\\n"), lines); + addListValue(key, StringUtils.split(value, "\n"), lines); } else { addNormalValue(key, value, lines); }