OkaeriPoland / okaeri-configs

Simple Java/POJO config library written with love and Lombok
MIT License
77 stars 11 forks source link

Newly added variables are not in the proper order #26

Closed plytki closed 2 years ago

plytki commented 2 years ago

Newly added variables are not in proper order

Steps to reproduce the behavior:

  1. Create configuration file with configurer presented below.
  2. Add new variable to your config class.
  3. Update your config.

Your newly added variables won't be placed in order as you initialized them in your config class.

All libs are versioned in 3.4.2.

ConfigManager.create(PluginConfiguration.class, (it) -> {
            it.withConfigurer(new OkaeriValidator(new YamlBukkitConfigurer(SectionSeparator.NEW_LINE), true), new SerdesBukkit());
            it.withBindFile(pluginConfigurationFile);
            it.saveDefaults();
            it.load(true);
        });
dasavick commented 2 years ago

4.0.0-beta6

Reproduced in:

Cannot reproduce:

Not applicable:

plytki commented 2 years ago

What is the ETA for the bug fix?

dasavick commented 2 years ago

No specific ETA due to non-critical nature of the issue. No time to spare for this specific issue at the moment. Pull requests and other contributions are welcome.

dasavick commented 2 years ago

Fixed in https://github.com/OkaeriPoland/okaeri-configs/commit/735057e309bcfd9bfea3f7846b129d8d29957e9e (4.0.0-beta21). Sorting is performed pre-save only, so Configurer#getAllKeys and similar can be out-of-order.