-
Notifications
You must be signed in to change notification settings - Fork 499
De-duplicate declarative recipes #6560
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
base: main
Are you sure you want to change the base?
Conversation
When initializing DeclarativeRecipe instances, work with a copy of the uninitialized list rather than modifying the original. This ensures that when the same recipe instance is initialized in multiple contexts, the modifications don't corrupt the instance state for other uses. The fix: 1. Create a copy of the uninitialized list before iteration 2. Remove duplicates from the copy during deduplication 3. Clear the original uninitialized list at the end to mark initialization complete This preserves recipe instance integrity across multiple initializations.
rewrite-core/src/main/java/org/openrewrite/config/DeclarativeRecipe.java
Outdated
Show resolved
Hide resolved
jkschneider
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please wait until at least Monday. I'm not saying it's wrong but would like to carefully consider. Very much worry about this.
|
One of my initial concerns: it feels pretty wrong to apply this uniquely to DeclarativeRecipe. Like using |
Let's stop spending time executing recipes that shouldn't do anything anyway - because a copy of them earlier in the recipe list already did the work