rewrite
rewrite copied to clipboard
Recognize recipes containing themself
What problem are you trying to solve?
I accidentally included a recipe in itself. The StackoverflowError should be avoided, and a clear error message should be presented.
Describe the solution you'd like
Check any nested recipe to not be in the "already seen" set at the beginning of the initialization request.
Additional context
---
type: specs.openrewrite.org/v1beta/recipe
name: myrecipes
displayName: My recipes
description: Accidentially contains itself
recipeList:
- myrecipes
java.lang.StackOverflowError
at org.openrewrite.config.DeclarativeRecipe.initialize (DeclarativeRecipe.java:96)
at org.openrewrite.config.DeclarativeRecipe.initialize (DeclarativeRecipe.java:91)
at org.openrewrite.config.DeclarativeRecipe.initialize (DeclarativeRecipe.java:106)
at org.openrewrite.config.DeclarativeRecipe.initialize (DeclarativeRecipe.java:91)
Are you interested in contributing this feature to OpenRewrite?
Yes.