Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Compare] Problem with getting RemoteRemoveModelElement vs. RemoteAddModelElement with 3 way compare
[Compare] Problem with getting RemoteRemoveModelElement vs. RemoteAddModelElement with 3 way compare [message #616163] Wed, 09 April 2008 20:40
Matt Seashore is currently offline Matt SeashoreFriend
Messages: 58
Registered: July 2009
Member
I'm doing a 3 way headless comparison (match+diff). In my test, the
ancestor has no children, the "left" model has a new child and the
"right" model has a new (also different) child. These two new children
show up through the match as "UnMatchedElements" which I believe is
correct.

However, when I run the Diff, the unmatched element on the "left" shows
up as a "RemoteRemoveModelElement" instead of a "RemoteAddModelElement"
whereas the "right" element shows up correctly as a "AddModelElement".
This seems like a bug, though I may be missing something.

I've put the serialization of the match and the diff below. Please let
me know if there's more information that would help or if there's
something like a 'snippet' I can modify to show the problem. I am
running against HEAD from CVS for emf compare and Eclipse 3.4 M6.

Thanks,

Matt


Match Model:

<?xml version="1.0" encoding="Cp1252"?>
<match:MatchModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:match="http://www.eclipse.org/emf/compare/match/1.1"
leftModel="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217"
rightModel="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6"
originModel="/objects/org.example.model.impl.AllObjectsContainedImpl@65dbe8">
<matchedElements xsi:type="match:Match3Element"
similarity="0.8777120315581853">
<leftElement
href="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217#/"/>
<rightElement
href="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6#/"/>
<originElement
href="/objects/org.example.model.impl.AllObjectsContainedImpl@65dbe8#/"/>
</matchedElements>
<unMatchedElements xsi:type="match:RemoteUnMatchElement">
<element
href="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217#RemoteAdd"/>
</unMatchedElements>
<unMatchedElements>
<element
href="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6#LocalAdd"/>
</unMatchedElements>
</match:MatchModel>

Diff Model:

<?xml version="1.0" encoding="Cp1252"?>
<diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1"
left="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217"
origin="/objects/org.example.model.impl.AllObjectsContainedImpl@65dbe8"
right="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:AddModelElement">
<leftParent
href="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217#/"/>
<rightElement
href="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6#LocalAdd"/>
</subDiffElements>
<subDiffElements xsi:type="diff:RemoteRemoveModelElement">
<leftParent
href="/objects/org.example.model.impl.AllObjectsContainedImpl@13a46b6#/"/>
<rightElement
href="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217#RemoteAdd"/>
</subDiffElements>
<leftParent
href="/objects/org.example.model.impl.AllObjectsContainedImpl@1487217#/"/>
</subDiffElements>
</ownedElements>
</diff:DiffModel>

Code snippet that runs the match/diff:

HashMap<String, Object> options = new HashMap<String, Object>();
GenericMatchEngine genericMatch = new GenericMatchEngine();

MatchModel match = genericMatch.resourceMatch(modelLeft.eResource(),
modelRight.eResource(), modelAncestor.eResource(),
options);

GenericDiffEngine diffEngine = new GenericDiffEngine();
final DiffModel diff = diffEngine.doDiff(match, true);
Previous Topic:[Teneo] org.jpox.sco.exceptions.NullsNotAllowedException on resource.save()
Next Topic:Hibernate map does not have the required flag set
Goto Forum:
  


Current Time: Tue Jun 15 01:44:44 GMT 2021

Powered by FUDForum. Page generated in 0.01397 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top