Community
Participate
Working Groups
Created attachment 266556 [details] Test case to reproduce A single-valued feature that subsets many-valued feature cannot be merged properly. e.g. InterfaceRealization::contract : Interface [1..1] {subsets Dependency::supplier [1..*]} A pair of matched InterfaceRealization models that have different contract (and supplier) produces following. - ReferenceChange(ADD, Dependency.supplier, value=left) - ReferenceChange(DELETE, Dependency.supplier, value=right) - ReferenceChange(CHANGE, InterfaceRealization.contract, value=left) If I merge all the changes, I think that the left and right models will be equivalent. However, these changes are not associated each other (even implication), these can be merged properly in LeftToRight, but RightToLeft is not.
I finally took some time to convert this to java 7 and remove the use of hamcrest to fit in the uml2 test plugins, and this is still reproducible with the latest master. I'll assume this is one of the "directional equivalences" from UML that we're not properly detecting at merge time.
This is a quirk of the UML implementation. Changing the contract of the InterfaceRealization from "OldInterface" to "NewInterface" _does not_ remove "OldInterface" from the "Suppliers". However, it does add "NewInterface" in there. Deleting "OldInterface" from the "Suppliers" does unset the "Contract". Adding "NewInterface" to the "Suppliers" does not set the Contract. Basically, we would need to have a very specific merger in this case. If we want to "set" the contract, we need to set the contract. If we want to "unset" the contract, we need to unset the supplier. if we want to "change" the contract, we need to first unset the supplier then set the contract. I believe the proper approach here is to create a new kind of UMLDiff (ContractChange?), that will encapsulate these three (ADD dependency.supplier, DELETE dependency.supplier, CHANGE Interface) in order to make a specific merger for it.
Created attachment 270126 [details] Manual reproduction models Attached are two models allowing us to reproduce manually
New Gerrit change created: https://git.eclipse.org/r/104761
Associated gerrit is Akira's test case for junit reproduction