Bug 479449 - No conflict raised on concurrent setting of lowerValue/upperValue of UML Multiplicity Elements
Summary: No conflict raised on concurrent setting of lowerValue/upperValue of UML Mult...
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Alexandra Buzila CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-09 11:57 EDT by Philip Langer CLA
Modified: 2016-06-15 08:18 EDT (History)
3 users (show)

See Also:


Attachments
Repo that illustrates the problem (76.51 KB, application/zip)
2015-10-09 11:57 EDT, Philip Langer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Langer CLA 2015-10-09 11:57:22 EDT
Created attachment 257200 [details]
Repo that illustrates the problem

To reproduce, merge multiplicity1 into multiplicity2. The merge is performed without raising a conflict. However, on both sides, the multiplicity is changed in different ways on the same pin. Thus, a conflict would be expected instead.

The underlying problem is that a UML Multiplicity Element (e.g., a property or a pin) initially doesn't contain a lowerValue and upperValue, which are both 0..1 containment references in the UML metamodel. If the user sets the multiplicity of a multiplicity element, the respective value objects (e.g., instances of LiteralInteger) are added to the lowerValue and upperValue references accordingly.

However, at least in this case, EMF Compare does not raise a conflict when concurrently setting the 0..1 containment references, which leads to overwriting the multiplicity values when merging; thus, the multiplicity changes of one side get lost.

It needs to be checked whether this issue also appears for general EMF models. In o.e.e.compare.tests.conflict.ConflictDetectionTest, it seems there are only tests regarding the conflict detection of 0..1 non-containment references (cf. testB3UseCaseForReference()).
Comment 1 Eclipse Genie CLA 2015-10-20 10:39:55 EDT
New Gerrit change created: https://git.eclipse.org/r/58525
Comment 2 Eclipse Genie CLA 2015-10-20 10:39:57 EDT
New Gerrit change created: https://git.eclipse.org/r/58524
Comment 3 Philip Langer CLA 2015-10-20 10:57:57 EDT
Concurrent additions to single-valued containment references weren't reported as conflicts so far. Thus, I pushed a change to enable reporting such conflicts for general EMF models: https://git.eclipse.org/r/#/c/58524/

However, this bug is not fully fixed yet: for UML models, users would expect that setting the multiplicity to the _same_ values wouldn't be real a conflict -- only a pseudo conflict. In the generic conflict detection, we check after change 58524 whether the equality helper considers the added objects as equal; if it considers them as equal, only a pseudo conflict is raised instead of a real one. However, the equality helper will not consider two added EObjects as equal (because it uses the match model for that). Consequently, it also won't consider two UML instance specifications, which are used to express multiplicities in UML, as equal even though they specify the same value. So I'll put a UML-specific handling for this on top of the pushed change.

I thought about solving this by customizing the equality helper for this purpose. We could let it return true if you ask for equality of two instance specifications that are contained by lowerValue and upperValue. The high road would be to introduce a UML multiplicity change and handle that in the UML-specific postprocessors.

Do you have thoughts on that? Thanks!
Comment 4 Axel RICHARD CLA 2015-10-27 09:36:29 EDT
Hi Philip,

Nice catch !

I agree with your proposal, it seems to be a good solution for that problem.

I will merge the first part https://git.eclipse.org/r/58524 of the contribution very soon.

Thank you.
Comment 6 Eclipse Genie CLA 2016-01-22 04:43:45 EST
New Gerrit change created: https://git.eclipse.org/r/64974
Comment 7 Eclipse Genie CLA 2016-02-07 13:25:12 EST
New Gerrit change created: https://git.eclipse.org/r/66075