Open blipper opened 1 year ago
Hi @blipper ; Thanks for reporting this here with a clear example. That's a surprising and unfortunate bug.
I've converted your example into a unit test that does indeed reproduce the issue:
@Test
void doNotRenameClassnameWhenItMatchesVariableName() {
rewriteRun(
java("""
class Fizz {}
"""),
java(
"""
class Foo {
void Bar() {
final Fizz Fizz = new Fizz();
}
}
""",
"""
class Foo {
void Bar() {
final Fizz fizz = new Fizz();
}
}
"""
)
);
}
This slots right into RenameLocalVariablesToCamelCaseTest.java if you care to have a look; it's a bit late on my timezone for a proper fix right now, but I've added your issue to the backlog.
Hi. Sorry. Are you asking for something from me?
Hi @blipper Oh no sorry; not unless you really want to! :) Figured make it easy for anyone to pick this up; that can be future-me, a colleague, you yourself or anyone from the community.
We don't yet have issue templates, otherwise this test structure would be the first thing I'd put in there to make it easier to report a working test to reproduce an issue.
No action required right now; we only need some time to pick up this bug and get that sorted for you.
failes due to transformation