Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Comparing Strings
[EMF Compare] Comparing Strings [message #508623] Tue, 19 January 2010 16:24 Go to next message
Roland S. is currently offline Roland S.Friend
Messages: 36
Registered: September 2009
Member
Hi.

I'm using Xtext and am trying to compare 2 files to check if the serialization behaves as supposed to. If I remove or add model elements, everything works fine and the changes are recognized. But changes in attributes that hold Strings seem not to be compared. So if I edit the content of an attribute that is of kind String, these changes are not computed. Do you have any hint for this kind of problem?

Thanks,
Roland

[Updated on: Wed, 20 January 2010 07:09]

Report message to a moderator

Re: [EMF Compare] Comparing Strings [message #508805 is a reply to message #508623] Wed, 20 January 2010 11:48 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010502010701050103000600
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Roland,

That would look like a bug ... But it is unlikely. The name of an EClass
is itself an EAttribute of type String, and a changed name is properly
detected as a difference by EMF Compare.

Can you be more precise as to how you trigger this issue?

Laurent Goubet
Obeo

Roland S. wrote:
> Hi.
>
> I'm using Xtext and am trying to compare 2 files to check if the
> serialization behaves as supposed to. If I remove or add model elements,
> everything works fine and the changes are recognized. But changes in
> attributes that hold Strings seem not to be compared. So if I edit the
> content of an attribute that is of kind String, these changes are not
> computed. Do you have any hint for this kind of problem?
>
> Thanks, Roland


--------------010502010701050103000600
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010502010701050103000600--
Re: [EMF Compare] Comparing Strings [message #509126 is a reply to message #508805] Thu, 21 January 2010 13:14 Go to previous messageGo to next message
Roland S. is currently offline Roland S.Friend
Messages: 36
Registered: September 2009
Member
Hi Laurent,

my code looks like:


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

options.put(MatchOptions.OPTION_DISTINCT_METAMODELS, false);
options.put(MatchOptions.OPTION_IGNORE_ID, true);
options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true);
	
EObject model1 = loader.loadModel(path1);
EObject model2 = loader.loadModel(path2);

MatchModel match = gme.modelMatch(model1, model2,options);



where model1 is the original file that is parsed by the ANTLR-parser generated with Xtext. Model2 represents the modified text file. The files contain classes similar to Java-classes. The class name is an attribute of type EString. When i change this name the difference is not recoqnized by modelMath().

I hope this helps.

Roland

Re: [EMF Compare] Comparing Strings [message #510350 is a reply to message #509126] Wed, 27 January 2010 05:38 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040508030803070509010608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Roland,

Sorry for the delay, didn't realize you had answered.

We've never faced this issue : names and other Strings are compared as
everything else, there is no special handling for EString-typed attributes.

I'll need the two models you're trying to compare in order to try and
help you any more than this, or basic samples to reproduce the issue.

Laurent Goubet
Obeo

PS : you should use MatchService.doMatch() instead of instantiating the
GenericMatchEngine and calling its "modelMatch()" method yourself.

Roland S. wrote:
> Hi Laurent,
>
> my code looks like:
>
>
>
> Map<String, Object> options = new HashMap<String, Object>();
> GenericMatchEngine gme = new GenericMatchEngine();
>
> options.put(MatchOptions.OPTION_DISTINCT_METAMODELS, false);
> options.put(MatchOptions.OPTION_IGNORE_ID, true);
> options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true);
>
> EObject model1 = loader.loadModel(path1);
> EObject model2 = loader.loadModel(path2);
>
> MatchModel match = gme.modelMatch(model1, model2,options);
>
>
>
> where model1 is the original file that is parsed by the ANTLR-parser
> generated with Xtext. Model2 represents the modified text file. The
> files contain classes similar to Java-classes. The class name is an
> attribute of type EString. When i change this name the difference is not
> recoqnized by modelMath().
> I hope this helps.
>
> Roland
>
>


--------------040508030803070509010608
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040508030803070509010608--
Re: [EMF Compare] Comparing Strings [message #622028 is a reply to message #508805] Thu, 21 January 2010 13:14 Go to previous messageGo to next message
Roland S. is currently offline Roland S.Friend
Messages: 36
Registered: September 2009
Member
Hi Laurent,

my code looks like:



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

options.put(MatchOptions.OPTION_DISTINCT_METAMODELS, false);
options.put(MatchOptions.OPTION_IGNORE_ID, true);
options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true);

EObject model1 = loader.loadModel(path1);
EObject model2 = loader.loadModel(path2);

MatchModel match = gme.modelMatch(model1, model2,options);



where model1 is the original file that is parsed by the ANTLR-parser generated with Xtext. Model2 represents the modified text file. The files contain classes similar to Java-classes. The class name is an attribute of type EString. When i change this name the difference is not recoqnized by modelMath().

I hope this helps.

Roland
Re: [EMF Compare] Comparing Strings [message #622050 is a reply to message #622028] Wed, 27 January 2010 10:36 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040508030803070509010608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Roland,

Sorry for the delay, didn't realize you had answered.

We've never faced this issue : names and other Strings are compared as
everything else, there is no special handling for EString-typed attributes.

I'll need the two models you're trying to compare in order to try and
help you any more than this, or basic samples to reproduce the issue.

Laurent Goubet
Obeo

PS : you should use MatchService.doMatch() instead of instantiating the
GenericMatchEngine and calling its "modelMatch()" method yourself.

Roland S. wrote:
> Hi Laurent,
>
> my code looks like:
>
>
>
> Map<String, Object> options = new HashMap<String, Object>();
> GenericMatchEngine gme = new GenericMatchEngine();
>
> options.put(MatchOptions.OPTION_DISTINCT_METAMODELS, false);
> options.put(MatchOptions.OPTION_IGNORE_ID, true);
> options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true);
>
> EObject model1 = loader.loadModel(path1);
> EObject model2 = loader.loadModel(path2);
>
> MatchModel match = gme.modelMatch(model1, model2,options);
>
>
>
> where model1 is the original file that is parsed by the ANTLR-parser
> generated with Xtext. Model2 represents the modified text file. The
> files contain classes similar to Java-classes. The class name is an
> attribute of type EString. When i change this name the difference is not
> recoqnized by modelMath().
> I hope this helps.
>
> Roland
>
>


--------------040508030803070509010608
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040508030803070509010608--
Previous Topic:[Announce][MTF] Creation Review was successful
Next Topic:EMF Compare Editor: How to add text compare tab?
Goto Forum:
  


Current Time: Mon Jun 14 22:41:32 GMT 2021

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

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

Back to the top