-
-
Notifications
You must be signed in to change notification settings - Fork 361
review fix: CtExecutableReference have all the same hashcode #1717
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
review fix: CtExecutableReference have all the same hashcode #1717
Conversation
@monperrus is it a wanted behaviour? It seems particularly weird to me, especially because it prevents us in using properly collection of references. |
Not really
I'd say it still works correctly, but inefficiently (many calls to equals) |
Why "correctly"? here the test shows that two completely distinct executable references have the same hashcode... |
I propose a fix here, but I'm not sure it's enough: several elements in Spoon may have the same hashCode issue. |
A hashCode is an approximation in essence. It's normal that you sometimes have collisions and the collection libraries know how to handle this. You have bad performance if you have too many collisions, but you have correct execution. |
This fix looks good to me. |
@monperrus it's ready for merging for me. |
9f96507
to
59b26c7
Compare
The CI is ok: we have an issue with gakoci because Java 8 release 151 seems not available through maven docker image easily. If you're ok I propose that you merge this one as I need it for #1707 |
It seems that Spoon make no distinction between reference hashcode: they all have a value to 1.