spring-attic / spring-ide

Spring Development Environment for Eclipse
299 stars 125 forks source link

STS does not apply expected refactoring with Lombok #288

Closed manueljordan closed 6 years ago

manueljordan commented 6 years ago

For STS latest version (3.9.4.RELEASE)

I can have a POJO annotated with Lombok (latest version), lets named Person. I can confirm that for the Person class Lombok generates the setter and getter methods how is expected. Other classes can use the Person class and work around through its methods that was generated through Lombok.

Problem if for a field of the Person class I do a refactor through the IDE, for example change a field named name to firstName, the Person class gets the new setter/getter reflected but the other classes that refers the Person class do not get the update from setName/getName to setFirstName/getFirsName. I must fix these changes manually.

Not sure if it is a "bug" of STS or by Eclipse.

kdvolder commented 6 years ago

Not sure if it is a "bug" of STS or by Eclipse.

I'd say its probably neither STS nor Eclipse. Lombok support, when installed into Eclipse or STS provides some 'magic' modifications to Eclipse JDT tooling. These magics are ultimately responsible for making stuff like this work for Lombok-enabled projects. So if it doesn't work, I think this is something for Lombok Eclipse extension to fix.

That is, unless this works in Lombok + pure Eclipse and it doesn't work in Lombok + STS setup. In that case, maybe there's something specific in STS that interferes with this working properly.

Have you tried if it works in plain Eclipse? If not, and you could find some time to do that, that would be helpful in deciding the correct course of action on dealing with this problem (i.e. whether STS should do some follow up, or whether this is something to report with the lombok folks instead).

manueljordan commented 6 years ago

Hello @kdvolder

Have you tried if it works in plain Eclipse?

I have confirmed the same behaviour with: eclipse-jee-oxygen-3a-macosx-cocoa-x86_64.dmg

Thus "seems" it should be reported to the Lombok team.

martinlippert commented 6 years ago

Ok, so closing this one here. Feel free to add a URL to the Lombok issue here for reference.