[EMF Compare] Comparing Strings [message #508623] |
Tue, 19 January 2010 16:24 |
Roland S. 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 |
|
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 #510350 is a reply to message #509126] |
Wed, 27 January 2010 05:38 |
|
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 #622050 is a reply to message #622028] |
Wed, 27 January 2010 10:36 |
|
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--
|
|
|
Powered by
FUDForum. Page generated in 0.03285 seconds