Make order of elements in saved JAR description file deterministic #1024 #1025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
When exporting JAR description files from the JarPackageWizard, the elements to be exported into the JAR file are currently stored in a non-deterministic order. This makes it particularly difficult to merge the description files in case they are put under version control. For a detailed description, see #1024.
This change makes a JAR description file exported from the JarPackageWizard always list the exported elements in the same order by sorting them according to their names. It also adds an according regression test.
Fixes #1024
How to test
The behavior can be tested by creating and updating a *.jardesc file from the JAR export wizard. Before this change, the order of elements in the *.jardesc file will vary upon each export, while after this change the order will be deterministic.
The added test case
WizardTests#testJarPackageWizard_sameElementOrderInJarDescriptionExports
simulates these multiple exports and can also be used for verification.Author checklist