You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, rename MyPojo.foo to MyPojo.bar, ensuring the getter and the setter are renamed as well.
After the renaming occurs, in GClass I see: println pojo.getBar
which is of course invalid.
The problem goes away if I remove @CompileStatic from GClass.
I'm pretty sure this used to work correctly in the past.
The text was updated successfully, but these errors were encountered:
mauromol
changed the title
Property refactoring fails in @CompileStatic Groovy classes (regression?)
Property refactoring generates invalid code in @CompileStatic Groovy classes (regression?)
Sep 23, 2022
There are a couple special AST formations that only static compilation uses. I think this is running into one of them since taking away @CompileStatic has it working as expected. I do have a unit test that recreates your result, so it shouldn't take long to get a fix together.
Using Greclipse 4.7.0.v202209190834-e2206.
Consider the following Java class:
And the following Groovy class:
Now, rename
MyPojo.foo
toMyPojo.bar
, ensuring the getter and the setter are renamed as well.After the renaming occurs, in
GClass
I see:println pojo.getBar
which is of course invalid.
The problem goes away if I remove
@CompileStatic
fromGClass
.I'm pretty sure this used to work correctly in the past.
The text was updated successfully, but these errors were encountered: