Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EcoreUtil.copyAll and EMap
EcoreUtil.copyAll and EMap [message #1007038] Mon, 04 February 2013 08:26 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
I have a model with an emap where the value is a non-containment ereference. It seems that EcoreUtil.copyAll does not
correctly copy the value of the emap elements (it is null). Is this a known issue?
If not then I can create a bugzilla (with a testcase) to show the problem.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: EcoreUtil.copyAll and EMap [message #1007045 is a reply to message #1007038] Mon, 04 February 2013 08:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Martin,

The Copier is not aware of EMaps. From that perspective an EMap is just
a containment reference to the EObjects that represent the Map.Entry
instances. So the value reference of the map entry will be copied
during copyReferences just like any other cross reference. The only
thing that would prevent copying is if it's a bidirectional reference
and the referenced object itself has not been copied...

So try setting a breakpoint (conditional on the reference's name being
"value") in
org.eclipse.emf.ecore.util.EcoreUtil.Copier.copyReference(EReference,
EObject, EObject) and see why its not copying the reference...


On 04/02/2013 9:26 AM, Martin Taal wrote:
> Hi,
> I have a model with an emap where the value is a non-containment
> ereference. It seems that EcoreUtil.copyAll does not correctly copy
> the value of the emap elements (it is null). Is this a known issue?
> If not then I can create a bugzilla (with a testcase) to show the
> problem.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EcoreUtil.copyAll and EMap [message #1007064 is a reply to message #1007045] Mon, 04 February 2013 10:10 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed,
Ouch, it was a problem in my code, so this post can be forgotten...

gr. Martin

On 02/04/2013 09:38 AM, Ed Merks wrote:
> Martin,
>
> The Copier is not aware of EMaps. From that perspective an EMap is just a containment reference to the EObjects that
> represent the Map.Entry instances. So the value reference of the map entry will be copied during copyReferences just
> like any other cross reference. The only thing that would prevent copying is if it's a bidirectional reference and the
> referenced object itself has not been copied...
>
> So try setting a breakpoint (conditional on the reference's name being "value") in
> org.eclipse.emf.ecore.util.EcoreUtil.Copier.copyReference(EReference, EObject, EObject) and see why its not copying the
> reference...
>
>
> On 04/02/2013 9:26 AM, Martin Taal wrote:
>> Hi,
>> I have a model with an emap where the value is a non-containment ereference. It seems that EcoreUtil.copyAll does not
>> correctly copy the value of the emap elements (it is null). Is this a known issue?
>> If not then I can create a bugzilla (with a testcase) to show the problem.
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[CDO] Problem with package on CDO M4, but not on M3
Next Topic:[Teneo] QuickStart Tutorial fails to create tables
Goto Forum:
  


Current Time: Thu Apr 25 16:56:48 GMT 2024

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

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

Back to the top