Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Compare] rightParent reference in DiffGroups
[EMF Compare] rightParent reference in DiffGroups [message #499623] Mon, 23 November 2009 14:53 Go to next message
Eclipse UserFriend
Originally posted by: mail.andreasscharf.com

Hi,

I'm currently getting unexpected elements if asking a DiffGroup for the
element via group.getRightParent(). Until now I thouhgt that
'rightParent' always refers to some element within the right model. But
in my DiffModel I get an element from the left model side.

Use case: Comparison of two UML Models:

ModelA
- ClassFoo
- ClassBar

ModelB
- ClassFoo
- classBarProperty : ClassBar
- ClassBar
- classFooProperty : ClassFoo
- Association (with memberends classBarProperty, classFooProperty)

where ModelA is my left and ModelB is my right.

Amongst other I get a DiffGroup with rightParent ModelA. Is that
behavior correct? I already took a look at bugzilla concerning a
possible bug but found nothing. Perhaps I understand something wrong...

Best regards,
Andreas

P.s.: I'm working with the HEAD revision.
Re: [EMF Compare] rightParent reference in DiffGroups [message #499839 is a reply to message #499623] Tue, 24 November 2009 10:58 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090006040709090104050307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Andreas,

This is a problem with us having only a "right"-named reference for the
DiffGroup, and an issue I always push the fixing for later. When the
element presenting a difference is not preset in the right model ...
well I set a reference to the left model in its stead.

Correction of https://bugs.eclipse.org/bugs/show_bug.cgi?id=243447 will
see the addition of a "leftParent" reference to the diffgroup, and a
behavior change for the "rightParent" for which "null" will become an
accepted value.

Laurent Goubet
Obeo

Andreas Scharf wrote:
> Hi,
>
> I'm currently getting unexpected elements if asking a DiffGroup for the
> element via group.getRightParent(). Until now I thouhgt that
> 'rightParent' always refers to some element within the right model. But
> in my DiffModel I get an element from the left model side.
>
> Use case: Comparison of two UML Models:
>
> ModelA
> - ClassFoo
> - ClassBar
>
> ModelB
> - ClassFoo
> - classBarProperty : ClassBar
> - ClassBar
> - classFooProperty : ClassFoo
> - Association (with memberends classBarProperty, classFooProperty)
>
> where ModelA is my left and ModelB is my right.
>
> Amongst other I get a DiffGroup with rightParent ModelA. Is that
> behavior correct? I already took a look at bugzilla concerning a
> possible bug but found nothing. Perhaps I understand something wrong...
>
> Best regards,
> Andreas
>
> P.s.: I'm working with the HEAD revision.


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

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------090006040709090104050307--
Re: [EMF Compare] rightParent reference in DiffGroups [message #499852 is a reply to message #499839] Tue, 24 November 2009 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.andreasscharf.com

Laurent,

I see the problem in only having a reference called rightParent. But in
my case there indeed is a right element (parent) available and even in
that case I get the left parent.

To be able to use EMF Compare I changed the following files in
GenericDiffEngine:

private DiffGroup buildHierarchyGroup(EObject targetParent, DiffGroup
root) {

// if targetElement has a parent, we call buildgroup on it, else we add
// the current group to the root
DiffGroup curGroup = DiffFactory.eINSTANCE.createDiffGroup();
> EObject rightSideParent = getMatchedEObject(targetParent, RIGHT_OBJECT);
curGroup.setRightParent(rightSideParent);
final DiffGroup targetGroup = findExistingGroup(root, rightSideParent);
if (targetGroup != null) {
curGroup = targetGroup;
}
if (rightSideParent.eContainer() == null) {
root.getSubDiffElements().add(curGroup);
return curGroup;
}
buildHierarchyGroup(rightSideParent.eContainer(),
root).getSubDiffElements().add(curGroup);
return curGroup;
}

Sorry for the bad formatting. Basically I don't simply set targetParent
but ask for a right element. I guess that if no match is available I'll
get null which is ok. I executed the MatchTestSuite and DiffTestSuite
without any problems but maybe you can have a very short thought at it
and point out any upcoming errors that I'm not aware off for now.

Another question concerning tests in EMF Compare (even it doesn't fit in
this topic): Are there really no merge tests or did I just miss them?

Best regards,
Andreas

Laurent Goubet schrieb:
> Hi Andreas,
>
> This is a problem with us having only a "right"-named reference for the
> DiffGroup, and an issue I always push the fixing for later. When the
> element presenting a difference is not preset in the right model ...
> well I set a reference to the left model in its stead.
>
> Correction of https://bugs.eclipse.org/bugs/show_bug.cgi?id=243447 will
> see the addition of a "leftParent" reference to the diffgroup, and a
> behavior change for the "rightParent" for which "null" will become an
> accepted value.
>
> Laurent Goubet
> Obeo
>
> Andreas Scharf wrote:
>> Hi,
>>
>> I'm currently getting unexpected elements if asking a DiffGroup for
>> the element via group.getRightParent(). Until now I thouhgt that
>> 'rightParent' always refers to some element within the right model.
>> But in my DiffModel I get an element from the left model side.
>>
>> Use case: Comparison of two UML Models:
>>
>> ModelA
>> - ClassFoo
>> - ClassBar
>>
>> ModelB
>> - ClassFoo
>> - classBarProperty : ClassBar
>> - ClassBar
>> - classFooProperty : ClassFoo
>> - Association (with memberends classBarProperty, classFooProperty)
>>
>> where ModelA is my left and ModelB is my right.
>>
>> Amongst other I get a DiffGroup with rightParent ModelA. Is that
>> behavior correct? I already took a look at bugzilla concerning a
>> possible bug but found nothing. Perhaps I understand something wrong...
>>
>> Best regards,
>> Andreas
>>
>> P.s.: I'm working with the HEAD revision.
>
Re: [EMF Compare] rightParent reference in DiffGroups [message #499901 is a reply to message #499852] Tue, 24 November 2009 13:50 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030602050502010501090608
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Andreas,

The only potential bugs I can think of are UI bugs. Like getting NPEs
when selecting a group in the structure panel of the comparison editor.
I'll have a look at this when I switch back to EMF Compare.

As for the tests, no, you read well. We do not yet have merge tests, and
yes, this is bad. We're currently looking into committing the tests
provided by Stephen McCants through
https://bugs.eclipse.org/bugs/show_bug.cgi?id=294336 and all related bugs.

Laurent Goubet
Obeo

Andreas Scharf wrote:
> Laurent,
>
> I see the problem in only having a reference called rightParent. But in
> my case there indeed is a right element (parent) available and even in
> that case I get the left parent.
>
> To be able to use EMF Compare I changed the following files in
> GenericDiffEngine:
>
> private DiffGroup buildHierarchyGroup(EObject targetParent, DiffGroup
> root) {
>
> // if targetElement has a parent, we call buildgroup on it, else we add
> // the current group to the root
> DiffGroup curGroup = DiffFactory.eINSTANCE.createDiffGroup();
> > EObject rightSideParent = getMatchedEObject(targetParent, RIGHT_OBJECT);
> curGroup.setRightParent(rightSideParent);
> final DiffGroup targetGroup = findExistingGroup(root, rightSideParent);
> if (targetGroup != null) {
> curGroup = targetGroup;
> }
> if (rightSideParent.eContainer() == null) {
> root.getSubDiffElements().add(curGroup);
> return curGroup;
> }
> buildHierarchyGroup(rightSideParent.eContainer(),
> root).getSubDiffElements().add(curGroup);
> return curGroup;
> }
>
> Sorry for the bad formatting. Basically I don't simply set targetParent
> but ask for a right element. I guess that if no match is available I'll
> get null which is ok. I executed the MatchTestSuite and DiffTestSuite
> without any problems but maybe you can have a very short thought at it
> and point out any upcoming errors that I'm not aware off for now.
>
> Another question concerning tests in EMF Compare (even it doesn't fit in
> this topic): Are there really no merge tests or did I just miss them?
>
> Best regards,
> Andreas
>
> Laurent Goubet schrieb:
>> Hi Andreas,
>>
>> This is a problem with us having only a "right"-named reference for
>> the DiffGroup, and an issue I always push the fixing for later. When
>> the element presenting a difference is not preset in the right model
>> ... well I set a reference to the left model in its stead.
>>
>> Correction of https://bugs.eclipse.org/bugs/show_bug.cgi?id=243447
>> will see the addition of a "leftParent" reference to the diffgroup,
>> and a behavior change for the "rightParent" for which "null" will
>> become an accepted value.
>>
>> Laurent Goubet
>> Obeo
>>
>> Andreas Scharf wrote:
>>> Hi,
>>>
>>> I'm currently getting unexpected elements if asking a DiffGroup for
>>> the element via group.getRightParent(). Until now I thouhgt that
>>> 'rightParent' always refers to some element within the right model.
>>> But in my DiffModel I get an element from the left model side.
>>>
>>> Use case: Comparison of two UML Models:
>>>
>>> ModelA
>>> - ClassFoo
>>> - ClassBar
>>>
>>> ModelB
>>> - ClassFoo
>>> - classBarProperty : ClassBar
>>> - ClassBar
>>> - classFooProperty : ClassFoo
>>> - Association (with memberends classBarProperty, classFooProperty)
>>>
>>> where ModelA is my left and ModelB is my right.
>>>
>>> Amongst other I get a DiffGroup with rightParent ModelA. Is that
>>> behavior correct? I already took a look at bugzilla concerning a
>>> possible bug but found nothing. Perhaps I understand something wrong...
>>>
>>> Best regards,
>>> Andreas
>>>
>>> P.s.: I'm working with the HEAD revision.
>>


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

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------030602050502010501090608--
Previous Topic:[CDO] server side resource consumption
Next Topic:Problem performance getString of ItemProvider
Goto Forum:
  


Current Time: Thu Apr 18 23:10:21 GMT 2024

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

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

Back to the top