Skip to content

Commit 8dec88d

Browse files
committed
Roll back adaptions for ConfigMe 1.4
1 parent e06445b commit 8dec88d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/fr/xephi/authme/message/updater/MigraterYamlFileResource.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import ch.jalu.configme.resource.PropertyReader;
44
import ch.jalu.configme.resource.YamlFileResource;
5-
import org.jetbrains.annotations.NotNull;
65
import org.yaml.snakeyaml.DumperOptions;
76
import org.yaml.snakeyaml.Yaml;
87

@@ -20,12 +19,12 @@ public MigraterYamlFileResource(File file) {
2019
}
2120

2221
@Override
23-
public @NotNull PropertyReader createReader() {
22+
public PropertyReader createReader() {
2423
return MessageMigraterPropertyReader.loadFromFile(getFile());
2524
}
2625

2726
@Override
28-
protected @NotNull Yaml createNewYaml() {
27+
protected Yaml createNewYaml() {
2928
if (singleQuoteYaml == null) {
3029
DumperOptions options = new DumperOptions();
3130
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
@@ -37,4 +36,12 @@ public MigraterYamlFileResource(File file) {
3736
}
3837
return singleQuoteYaml;
3938
}
39+
40+
// Because we set the YAML object to put strings in single quotes, this method by default uses that YAML object
41+
// and also puts all paths as single quotes. Override to just always return the same string since we know those
42+
// are only message names (so never any conflicting strings like "true" or "0").
43+
@Override
44+
protected String escapePathElementIfNeeded(String path) {
45+
return path;
46+
}
4047
}

0 commit comments

Comments
 (0)