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

Mutate delayed execution code stored in static fields #1344

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

hcoles
Copy link
Owner

@hcoles hcoles commented Aug 28, 2024

We don't want to mutate code executed only during static initialization. Unfortunately, the current filtering also picks up code that is executed after static initialization as lambdas.

This change implements an imperfect compromise where code stored as Suppliers, Functions etc will be considered for mutation.

This will fail to mutate delayed execution code stored in other types, and will incorrectly mutate code that is executed only during initialization if it is within a method that returns a Supplier etc.

Although imperfect, it is an improvement.

We don't want to mutate code executed only during static initialization.
Unfortunately the current filtering also picks up code that is executed
after static initialization as lambdas.

This change implelements an imperfect comprimise where code stored as
Suppliers, Functions etc will be considered for mutation.

This will fail to mutate delayed execution code stored in other types,
and will incorrectly mutate code that is executed only during
initialization if it is within a method that returns a Supplier etc.

Although imperfect, it is an improvement.
@hcoles hcoles merged commit 7497570 into master Aug 28, 2024
7 checks passed
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.

1 participant