powsybl-core
powsybl-core copied to clipboard
Fix random ordering in index identifables and in extendable extensions
Please check if the PR fulfills these requirements
- [x] The commit message follows our guidelines
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
Does this PR already have an issue describing the problem? No
What kind of change does this PR introduce? Bug fix
What is the current behavior? Two collections returned are in random order:
-
NetworkIndex::getIdentifiables
are values of aHashMap
-
AbstractExtendable::getExtensions
are values of aHashMap
Leading to unwanted behaviour:
- Random order when writing extensions and corresponding namespaces
- Random order of all equipments when merging two networks
- Random order when validating equipments (thrown exception might vary from one run to the other)
What is the new behavior (if this is a feature change)?
The corresponding HashMap
s are replaced by LinkedHashMap
s
Does this PR introduce a breaking change or deprecate an API?
- [ ] Yes
- [x] No