Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Problem comparing identical GMF-resources
[EMF Compare] Problem comparing identical GMF-resources [message #620367] Sun, 26 October 2008 20:34
Martin Fluegge is currently offline Martin FlueggeFriend
Messages: 141
Registered: July 2009
Senior Member
Hi,

I have a problem when I compare two XML-files which contain a
GMF-Resource and the referenced EMF-Resource.

The GMF-Resource only contains a diagram, 2 Nodes an an Edge between
them. All objects have XMI-ids.
When I compare them programatically the comparison always finds an
"UpdateAttribute" in the Edge's BendPoints, but both XML-Files are
identically.
I am using EMF Compare 0.8.1.

Here is the source-code (maybe there is a bug in there)

----------- begin ----------

final ResourceSet modelResourceSet = new ResourceSetImpl();


modelResourceSet.getPackageRegistry().put("http://www.eclipse.org/gmf/runtime/1.0.1/notation",
NotationPackage.eINSTANCE);
modelResourceSet.getPackageRegistry().put("http://www.umleditor.de",
UmleditorPackage.eINSTANCE);

Resource resource1 = ModelUtils.load(
URI.createFileURI("Z:/compare/default2.umleditor_diagram"),
modelResourceSet).eResource();
Resource resource2 = ModelUtils.load(
new java.io.File("Z:/compare/default2.umleditor_diagram2"),
modelResourceSet).eResource();


final MatchModel match = MatchService.doResourceMatch(resource1,
resource2, null);
// Detects differences
final DiffModel diff = DiffService.doDiff(match, false);
printChanges(diff);
---------- end -----------


When I run the code it always prints:


----------- begin ----------
1 change(s) in Diagram default2.umleditor_diagram(class
org.eclipse.emf.compare.diff.metamodel.impl.DiffGroupImpl)
1 change(s) in Edge true(class
org.eclipse.emf.compare.diff.metamodel.impl.DiffGroupImpl)
1 change(s) in RelativeBendpoints
[org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@698403
(sourceX: -26, sourceY: 1, targetX: 123, targetY: 3),
org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@15a0305
(sourceX: -149, sourceY: 18, targetX: 0, targetY: 20)](class
org.eclipse.emf.compare.diff.metamodel.impl.DiffGroupImpl)
Attribute points in
[org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@698403
(sourceX: -26, sourceY: 1, targetX: 123, targetY: 3),
org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@15a0305
(sourceX: -149, sourceY: 18, targetX: 0, targetY: 20)] has changed from
[org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@698403
(sourceX: -26, sourceY: 1, targetX: 123, targetY: 3),
org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@15a0305
(sourceX: -149, sourceY: 18, targetX: 0, targetY: 20)] to
[org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@1c247a0
(sourceX: -26, sourceY: 1, targetX: 123, targetY: 3),
org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint@1ec6696
(sourceX: -149, sourceY: 18, targetX: 0, targetY: 20)](class
org.eclipse.emf.compare.diff.metamodel.impl.UpdateAttributeI mpl)
---------- end -----------



Here is the resource-xml-file I am trying to compare:

----------- begin ----------

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
xmlns:umleditor="http://www.umleditor.de">
<umleditor:UMLDiagram xmi:id="_reTkIaOQEd2Eot2PsuBu8Q">
<Klassen xmi:type="umleditor:Klasse"
xmi:id="_N_KeMaOTEd23GO0a2WhQjA"
erbendeKlassen="_WB2iQKOTEd23GO0a2WhQjA" name="Martin"/>
<Klassen xmi:type="umleditor:Klasse"
xmi:id="_WB2iQKOTEd23GO0a2WhQjA" name="Max"/>
</umleditor:UMLDiagram>
<notation:Diagram xmi:id="_rfDLAKOQEd2Eot2PsuBu8Q" type="Dawn"
element="_reTkIaOQEd2Eot2PsuBu8Q" name="default2.umleditor_diagram"
measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_OAWxAKOTEd23GO0a2WhQjA"
type="1001" element="_N_KeMaOTEd23GO0a2WhQjA">
<children xmi:type="notation:Node"
xmi:id="_OApr8KOTEd23GO0a2WhQjA" type="4001"/>
<styles xmi:type="notation:ShapeStyle"
xmi:id="_OAWxAaOTEd23GO0a2WhQjA"/>
<layoutConstraint xmi:type="notation:Bounds"
xmi:id="_OAWxAqOTEd23GO0a2WhQjA" x="200" y="125"/>
</children>
<children xmi:type="notation:Node" xmi:id="_VRuF0KOTEd22PaIR9R_YyQ"
type="1001" element="_WB2iQKOTEd23GO0a2WhQjA">
<children xmi:type="notation:Node"
xmi:id="_WCcYI6OTEd23GO0a2WhQjA" type="4001"/>
<styles xmi:type="notation:ShapeStyle"
xmi:id="_WCcYIaOTEd23GO0a2WhQjA"/>
<layoutConstraint xmi:type="notation:Bounds"
xmi:id="_WCcYIqOTEd23GO0a2WhQjA" x="57" y="123"/>
</children>
<styles xmi:type="notation:DiagramStyle"
xmi:id="_bk4X4aOREd21ceEQVasm_Q"/>
<edges xmi:type="notation:Edge" xmi:id="_dm4Z8KOTEd23GO0a2WhQjA"
type="3001" source="_OAWxAKOTEd23GO0a2WhQjA"
target="_VRuF0KOTEd22PaIR9R_YyQ">
<styles xmi:type="notation:ConnectorStyle"
xmi:id="_dm4Z8aOTEd23GO0a2WhQjA"/>
<styles xmi:type="notation:FontStyle"
xmi:id="_dm4Z8qOTEd23GO0a2WhQjA"/>
<element xsi:nil="true"/>
<bendpoints xmi:type="notation:RelativeBendpoints"
xmi:id="_dm4Z86OTEd23GO0a2WhQjA" points="[-26, 1, 123, 3]$[-149, 18, 0,
20]"/>
</edges>
</notation:Diagram>
</xmi:XMI>

---------- end -----------



When I change the code to match the same resource-object (
MatchService.doResourceMatch(resource1, resource1, null);) there is no
change found. So it seems that the objects are not matched by xmi-id but
it's adress.

After searching I found this
bugzilla:https://bugs.eclipse.org/bugs/show_bug.cgi?id=24216 4
Maybe this problem is related to mine?


I am quite new the to world of Eclipse-Frameworks so I am not sure
whether the problem is a normal behavior, a bug or my mistake.


Thanks a lot in advance.

Best Regards,

Martin
Previous Topic:current compare builds?
Next Topic:Setting up dev env for Teneo Hibernate
Goto Forum:
  


Current Time: Sun Apr 05 07:29:48 GMT 2020

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

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

Back to the top