Closed timo-abele closed 9 months ago
That's odd; normally we shorten qualified type references in the generated recipe. 🤔 https://github.com/openrewrite/rewrite-templating/blob/0e4a1440df56537041bbc86294dc77f22758c288/src/main/java/org/openrewrite/java/template/internal/AbstractRefasterJavaVisitor.java#L44-L46
Now I'm wondering if that EmbeddingOption.SHORTEN_NAMES
is correctly set on your generated recipe, or if it's not what factors in there. To be investigated and fixed!
duplicate of #66, as far as I understand.
Awesome, thanks for the fix @Bananeweizen ! Proactively closing this one; hope to hear from @timo-abele that his issue has been resolved too.
I confirm, after switching to template snapshots, the tests work!
What version of OpenRewrite are you using?
I am editing https://github.com/moderneinc/rewrite-recipe-starter/commit/3fd5d7a38d7fccb8cb55cbb62277e7bd5af3004a directly
How are you running OpenRewrite?
I'm running
SimplifyTernaryTest#simplified
in the IDE.What is the smallest, simplest way to reproduce the problem?
see https://github.com/timo-abele/rewrite-recipe-starter/tree/debug/refaster
The modified SimplifyTernaryTest should create an import statement, but inlines the package info instead:
Are you interested in contributing a fix to OpenRewrite?
no