Yaml#addDefaultsFromInputStream messes the order of keys even if the DataType is sorted #81
Open
Description
Describe the bug
When you use Yaml#addDefaultsFromInputStream, the saved config is no longer ordered, even if you set DataType.SORTED
.
To Reproduce
The following code produces an unordered Yaml file.
private Yaml loadLangConfig(String langCode) {
File file = new File(langFolder.toPath().toString(), langCode + ".yml");
Yaml langConfig = SimplixBuilder.fromFile(file)
.setReloadSettings(ReloadSettings.INTELLIGENT)
.setDataType(DataType.SORTED)
.createYaml();
InputStream resource = getDefaultLangFileStream(langCode);
if (resource == null) {
resource = getDefaultLangFileStream(settings.getDefaultLanguage());
if (resource == null)
resource = getDefaultLangFileStream("en_us.yml");
}
langConfig.addDefaultsFromInputStream(resource);
return langConfig;
}
Metadata
Assignees
Labels
No labels