Closed nmck257 closed 8 months ago
Really helpful to have the test provided, and a link to the Spring recipe that shows it's not an edge case. I'd say this is still a very valid one to pick up, as we should not create any unnecessary output changes. Help would be appreciated if possible!
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
RewriteTest
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
Success
What did you see instead?
What is the full stack trace of any errors you encountered?
N/A
Are you interested in contributing a fix to OpenRewrite?
I probably could, if it feels like a low-priority which y'all aren't eager to fix.
The test case probably seems a bit contrived, but, an existing
rewrite-spring
recipe (ReplaceExtendWithAndContextConfiguration
) does it: https://github.com/openrewrite/rewrite-spring/blob/847804059e1b568026a155cb17f3e732ad2fe6be/src/main/java/org/openrewrite/java/spring/boot2/ReplaceExtendWithAndContextConfiguration.java#L96Arguably, that recipe is autoformatting a bit over-eagerly, but I think the scenario discovered here is still valid.