New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse can't generate equals and hashCode on a @Data annotated class #211

Closed
lombokissues opened this Issue Jul 14, 2015 · 6 comments

Comments

1 participant
@lombokissues
Copy link
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 138)

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

👤 pablo.cabrera.munoz   🕗 Aug 03, 2010 at 12:36 UTC

What steps will reproduce the problem?

  1. Create a class with some fields (the Mountain one from the demo should do it)
  2. Put the @ Data annotation
  3. Ask eclipse to generate equals and hashcode with say only the "name" field.

What is the expected output? What do you see instead?
I would expect Eclipse to generate the equals and hashcode methods, overriding the ones that are given by the @ Data annotation.

Instead I get an error that says "Overlapping text edits".

What version of the product are you using? On what operating system?
I'm using lombok v0.9.3 with eclipse 3.5.2 on WinXP 32

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Aug 04, 2010 at 05:35 UTC

Known and extremely hard to solve issue. We'll get to this one last (there are some refactor scripts that are broken too, which have higher priority) as its a somewhat rare activity, and there's a trivial workaround: Remove the @ Data annotation, run the source generator script, re-add the @ Data annotation.

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

👤 pablo.cabrera.munoz   🕗 Aug 04, 2010 at 11:03 UTC

I've done that and it worked, but just wanted to point it out if it hasn't been addressed so far.

Great work btw!

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Nov 15, 2011 at 13:58 UTC

Actually, a new contributor (Jappe van der Hel) has been looking at some eclipse internals and he fixed this one by patching eclipse's ListRewriter. The commit itself is quite small though I'm sure the time spent digging through the internals was sizable. At any rate, yay! Should be in the version after 0.10.2.

Fixed in commit b43cd35.

Can all people affected by this give the latest edge build a whirl? Please report back here if formatting now works (or doesn't work!) You can find the edge release at:

https://projectlombok.org/download-edge.html

@lombokissues lombokissues removed the accepted label Jul 14, 2015

@lombokissues lombokissues added this to the 0.10.3 milestone Jul 14, 2015

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Nov 21, 2011 at 23:02 UTC

Now in release 0.10.4

@lombokissues lombokissues modified the milestones: 0.10.3, 0.10.4 Jul 14, 2015

@lombokissues

This comment has been minimized.

Copy link
Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment