Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » EMF Compare - two equivalent updateReference seen as different
EMF Compare - two equivalent updateReference seen as different [message #1155088] Fri, 25 October 2013 17:32 Go to next message
d 627 is currently offline d 627Friend
Messages: 28
Registered: March 2013
Junior Member

I got a question about the what is seen as an updatereference in emfCompare. I am comparing two different models and among other results, I am having some references indicated as a change but these have not been touched from one model to other.

The results look like this:

Reference classifier in ClassA changed from xxxx.EClassImpl@xxx (name: StringConstant) (instanceClassName: null) (abstract: false, interface: false) to xxxx.EClassImpl@xxx (name: StringConstant) (instanceClassName: null) (abstract: false, interface: false)

As you can see there is not, at least in this case, any change.

During the analysis there were 87 updatereferences indicated but some of them obviously were the same. So it was necessary to do this:

EObject compare;

if(compare instance of UpdateReference){
UpdateReference obj = ((UpdateReference)compare);
System.out.println("The real different updatereference are " obj);

In this way it was possible to reduce the number of updatereference to 26 and using the ECoreutil.equals method this number decreased to 7, 3 of these references are obviously different but the other 4 seem to be the same from the point of view of the attributes. The question is, what EMFCompare use to make the comparision between to references to indicate a change?, and how it is possible see this values in order to understand which ones among them are generating this output.


[Updated on: Tue, 29 October 2013 17:24]

Report message to a moderator

Re: EMF Compare - two equivalent updateReference seen as different [message #1162320 is a reply to message #1155088] Wed, 30 October 2013 09:46 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1895
Registered: July 2009
Senior Member

As has been told before, "equals" cannot be used on EObjects to determine equality or inequality, especially between two models that are considered to contain differences. An EObject which name is "Magazine" might very well be the same as an EObject named "Book" but with a super-type "Periodical" added to it. This is only false when the EObjects have identifiers, in which case they can be used to determine mappings.

EMF Compare 1 "equality" between EObjects is determined through a number of metrics, and you'll have to look at them in order to determine what to change (see also the FAQ answer). You'll have to override the GenericDiffEngine's 'ReferenceCheck' if your method of computing differences is to be different (or if some features have to be ignored).

Laurent Goubet
Previous Topic:Looking for an EObject inside an EList
Next Topic:Merging conflicting models?
Goto Forum:

Current Time: Tue Oct 26 00:34:21 GMT 2021

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

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

Back to the top