| Summary: | [EMF-Databinding] EObjectObservableMap improperly handles changes when more than one EStructuralFeature is Mapped | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Trevor <endante> | ||||||
| Component: | Core | Assignee: | Marcelo Paternostro <marcelop> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Ed.Merks, nboldt | ||||||
| Version: | 2.4.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Trevor
Created attachment 87947 [details]
patch to fix bug
Created attachment 87949 [details]
Compare against the actual feature instance
This approach is more efficient (and correct). You have to be very careful when using EStructuralFeature.getFeatureID anywhere because this is not necessarily the ID that will be used with any particular class. If the feature is inherited by multiple inheritance rather than as the first super class, the IDs in that class will be offset. I.e., x.getFeatureID and eClass.getFeatureID(x) might not be == for the same feature instance x. It's very tricky. :-(
We need to find time to deal with the TODO case as well, i.e., for multi-valued features. If you'd care to create a test case, I'd be happy to help make the scenario work properly...
Thanks for the testing and for supplying patches!
The changes are committed to CVS for 2.4. I changed it slightly more to test the feature before testing is touch, since 99% of the time touch will be false and it's just as likely to be for a different feature in which case isTouch doesn't need to be tested. I made corresponding changes for list and value (and changed them to use == for the feature rather than .equals). The changes are committed to CVS for 2.4. Fix available in HEAD: 2.4.0.I200801292000. |