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 HiddenField recipe predictable #2596

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

knutwannheden
Copy link
Contributor

By using a LinkedHashSet rather than a regular HashSet in FindNameShadows#find() to collect the shadowing variables, the renaming of the variables becomes predictable. I.e. the same variable always gets renamed to the same name if the recipe is tested multiple times. This is especially important for tests.

Fixes #2592

By using a `LinkedHashSet` rather than a regular `HashSet` in `FindNameShadows#find()` to collect the shadowing variables, the renaming of the variables becomes predictable. I.e. the same variable always gets renamed to the same name if the recipe is tested multiple times. This is especially important for tests.

Fixes openrewrite#2592
@sambsnyd sambsnyd merged commit c12cd9a into openrewrite:main Jan 4, 2023
@sambsnyd
Copy link
Member

sambsnyd commented Jan 4, 2023

Thanks @knutwannheden !

@knutwannheden knutwannheden deleted the hiddenfield-fix branch January 19, 2023 22:14
@sambsnyd sambsnyd added this to the 7.35.0 milestone Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

HiddenField renames catch clause variables non-deterministically
2 participants