Skip to content
New issue

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

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

Already on GitHub? # to your account

Make equals symmetric #39

Merged
merged 1 commit into from
Nov 20, 2015
Merged

Make equals symmetric #39

merged 1 commit into from
Nov 20, 2015

Conversation

codecholeric
Copy link

Hi,

I think the generated equals code is somewhat flawed by creating equals methods that are not symmetric. We actually had a problem with this in our project, because adding a supertype to a HashSet would prevent any subtype with no preinitialized properties to be added to the Set, while the other way around adding is possible (the instanceof check instead of type equality). Thus this can lead to really erratic behavior (in our case we injected multibound generated classes via Guice and depending on the order Guice decided to add these types to the Set to inject, we ended up with a different amount of elements).

Greetings,
Peter

@highsource highsource added the bug label Nov 20, 2015
@highsource highsource added this to the 0.9.6 milestone Nov 20, 2015
@highsource highsource self-assigned this Nov 20, 2015
highsource added a commit that referenced this pull request Nov 20, 2015
@highsource highsource merged commit e16f27c into highsource:master Nov 20, 2015
highsource added a commit that referenced this pull request Nov 20, 2015
@highsource
Copy link
Owner

Just added this., otherwise it's good.

I'll bump the version because this is potentially backwards incompatible.

Thank you for your contribution.

@codecholeric
Copy link
Author

Great, thanks for the merge :-) Looking forward to 0.9.6 then,so we can throw away the patched version in our local Nexus :-)

Am 21. November 2015 00:02:04 MEZ, schrieb Alexey Valikov notifications@github.com:

Just added this., otherwise it's good.

I'll bump the version because this is potentially backwards
incompatible.

Thank you for your contribution.


Reply to this email directly or view it on GitHub:
#39 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants