Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make order of elements in saved JAR description file deterministic #1024 #1025

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

HeikoKlare
Copy link
Contributor

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

@iloveeclipse
Copy link
Member

/rebase

Note: currently the PR fails because of stupid quality gate => #1026
However if rebased, it will fail due #1028...

Still rebasing to see if we only get one test fail.

@iloveeclipse
Copy link
Member

/rebase

…lipse-jdt#1024

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.

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 eclipse-jdt#1024
@iloveeclipse iloveeclipse merged commit 6cc39d9 into eclipse-jdt:master Dec 21, 2023
7 checks passed
@HeikoKlare HeikoKlare deleted the issue-1024 branch December 21, 2023 16:24
@HeikoKlare
Copy link
Contributor Author

Thanks for processing this PR so quickly, @iloveeclipse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entries of JAR description files saved while exporting a JAR have non-deterministic order
2 participants