Community
Participate
Working Groups
Adding the same values in a multi value attribute/reference but in a different order in two models only creates pseudo conflict instead of real conflict. For example I have a multi value reference in my origin model. In the version Mx of my model, I add 3 values in this order A,B and C. In the version My of my model, I add the same 3 values in this order C,B and A. It gives: Left | Right ------------------------- A | C B | B C | A EMF Compare should detect a conflict between the addition of A and C in my model Mx and My. Instead it only creates pseudo conflict. The problem comes from the org.eclipse.emf.compare.conflict.DefaultConflictDetector.matchingIndices(Comparison, Match, EStructuralFeature, Object, Object) method that does not handle correctly the index of the 2 newly added elements.
Here is a review that demonstrate this bug: https://git.eclipse.org/r/#/c/37977/
This will be difficult to solve because we see "additions" to be at index "0" in this case (everything added, so the "initial" lists are empty). This also causes issues with the merge since "pseudo" conflict do nothing on the merge, whereas this should call the check for ordering (see org.eclipse.emf.compare.merge.ReferenceChangeMerger.internalCheckOrdering(ReferenceChange, boolean) for example).