-
Notifications
You must be signed in to change notification settings - Fork 7
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
missing SHORTEN_NAMES for parameterless recipes #66
Comments
Thanks for the in depth look and offer to help @Bananeweizen ; do you want me to assign this issue to you then? |
Yes, I already started debugging this, but might take a bit more of my spare time to get used to the environment. |
Sure! Appreciate you exploring a type of recipe we hadn't tested before. Looking over the example once more it seems like a reimplementation of Replace String literal with constant, but with compile time checking; neat! |
Deduplicate the logic for creating the recipe code to avoid an inconcistency in how the embedOptions are used. Fixes openrewrite#66.
Deduplicate the logic for creating the recipe code to avoid an inconcistency in how the embedOptions are used. Fixes #66.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
The generated recipe should contain SHORTEN_NAMES. It's meant to be generated with every recipe, according to
rewrite-templating/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java
Line 272 in 0e4a144
What did you see instead?
No additional recipe references. Therefore running the recipe leads to a FQN for
SomeClass.SOME_CONSTANT
. (Workaround: Add theShortenFullyQualifiedTypeReferences
to the recipe list explicitly).Root cause is
rewrite-templating/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java
Line 278 in 0e4a144
embedOptions
collection (it does this correctly in https://github.com/openrewrite/rewrite-templating/blob/main/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java#L284).Are you interested in contributing a fix to OpenRewrite?
Yes. I would combine the 2 code blocks to remove the code duplication, since such code duplications will lead to similar failures again.
The text was updated successfully, but these errors were encountered: