Bug 454754 - Wrong conflict type for adding identical values in a different order in two different models
Summary: Wrong conflict type for adding identical values in a different order in two d...
Status: NEW
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 10:42 EST by Arthur Daussy CLA
Modified: 2014-12-11 05:50 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Daussy CLA 2014-12-10 10:42:05 EST
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.
Comment 1 Arthur Daussy CLA 2014-12-10 12:01:20 EST
Here is a review that demonstrate this bug:
https://git.eclipse.org/r/#/c/37977/
Comment 2 Laurent Goubet CLA 2014-12-11 05:50:24 EST
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).