Open blipper opened 3 months ago
Thanks for the clear example and offer to help @blipper! Must say it's appreciated how diligently you're reporting issues you come across. Really helps fix any blind spots.
Your examples would fit right in as a unit test, similar to this earlier one: https://github.com/openrewrite/rewrite-testing-frameworks/blob/30f35fe919b8166c19ddf22e2f1ea1c0d918487a/src/test/java/org/openrewrite/java/testing/cleanup/RemoveTestPrefixTest.java#L328-L347
Once there's a test we will likely want to add a similar exemption as seen here: https://github.com/openrewrite/rewrite-testing-frameworks/blob/30f35fe919b8166c19ddf22e2f1ea1c0d918487a/src/main/java/org/openrewrite/java/testing/cleanup/RemoveTestPrefix.java#L125-L138
Your exact example might already work if the name of the static imported method matches the renamed test; but with a few small adjustments I'm sure we can find a way to fail and then fix the issue.
What version of OpenRewrite are you using?
Latest
How are you running OpenRewrite?
gradle
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
What did you see instead?
What is the full stack trace of any errors you encountered?
Compilation will fail
Are you interested in contributing a fix to OpenRewrite?
Yes