Community
Participate
Working Groups
Created attachment 181690 [details] Patch against trunk, r1115 In EMF, equals and hashCode need to be implemented with object identity semantics (as per http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg05253.html). If we in the future decide to enable CDO, this rule is actually enforced, as CDOObjectImpl declares these methods as final. The attached patch changes the implementation of the three models that don't currently comply with this rule: STEMTime, DoubleValue, and StringValue. Instead of implementing equals, these classes now have a method called "valueEquals" which checks equality based on value. The hashCode method is removed. All places where equality checks are done for these classes need to be updated. The patch does this for all instances I was able to find. I'm not 100% this covers all of them, though, and I hope someone with a deeper understanding of the codebase will double-check this. The patch also introduces final implementations of equals and hashCode in IdentifiableImpl, so that this rule will be enforced in all models that derive from it.
Thanks Tero for the patch. Assigning to myself to evaluate for inclusion.
forgot to move to assigned.
Thanks again, Tero, for the contribution. I have reviewed the patch and can confirm that it complies with Eclipse conventions and does not contain any items (cryptography) that require additional approvals. Tero, please confirm again: 1) The code contributed was authored by you alone 2) That you have permission to submit this code to Eclipse (we have your contribution form on record, this is just a confirmation).
(In reply to comment #3) > Tero, please confirm again: > 1) The code contributed was authored by you alone > 2) That you have permission to submit this code to Eclipse (we have your > contribution form on record, this is just a confirmation). I confirm both points.
Patch applied and committed to trunk for revision 1122. Affected projects: org.eclipse.stem.core org.eclipse.stem.tests.core Thank you again, Tero.
Complete