Skip to content

Use a TreeSet instead of HashSet to get consistent ordering of results #352

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

laeubi
Copy link
Contributor

@laeubi laeubi commented Jan 30, 2024

Currently a HashSet is used to collect the source files, this means that the order returned is unspecified and in the worst case even random across machines/jvms. In some rare cases it could happen that this even has a slight influence on the produced class files if sources are processed in different order and therefore threat reproducible builds.

This now uses a TreeSet instead of a HashSet so the results are always in a deterministic order using the String#compare contract.

Currently a HashSet is used to collect the source files, this means that
the order returned is unspecified and in the worst case even random
across machines/jvms. In some rare cases it could happen that this even
has a slight influence on the produced class files if sources are
processed in different order and therefore threat reproducible builds.

This now uses a TreeSet instead of a HashSet so the results are always
in a deterministic order using the String#compare contract.
@olamy olamy merged commit f779b08 into codehaus-plexus:master Jan 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants