Bug 142115 - Copy/Paste infrastructure should call EcoreUtil#remove() before adding pasted EObjects to new containers
Summary: Copy/Paste infrastructure should call EcoreUtil#remove() before adding pasted...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P1 critical
Target Milestone: 1.0   Edit
Assignee: Vishy Ramaswamy CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-05-16 19:04 EDT by Nicholas Bennett CLA
Modified: 2010-07-19 12:25 EDT (History)
0 users

See Also:


Attachments
patch as described in bug (2.22 KB, patch)
2006-05-16 20:36 EDT, Nicholas Bennett CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Bennett CLA 2006-05-16 19:04:12 EDT
During the paste part of a cut/copy/paste operation, the GMF copy/paste infrastructure adds pasted elements to their new container without first calling EcoreUtil.remove().  For elements that are contained in a feature that supports cross-resource containment, this will correctly set the container of the element at the metamodel level, but will leave it contained within the LoadingEMFResource at the EMF level.  Subsequent post-processing will treat this case as an indication that the paste operation failed and replace the pasted element with a proxy reference.  In the cut/paste scenario, this reference will never be resolvable because the proxy URI refers to the source model for the element, from which it has been removed.  Also, the target resource will have problems saving and reloading because of these dangling hrefs to unresolvable proxies.

Attached is a patch to org.eclipse.gmf.runtime.emf.clipboard.core.ClipboardSupportUtil that fixes this problem.  Please consider applying it.
Comment 1 Nicholas Bennett CLA 2006-05-16 20:36:20 EDT
Created attachment 41681 [details]
patch as described in bug
Comment 2 Vishy Ramaswamy CLA 2006-05-17 10:27:03 EDT
Reviewed and applied patch
Comment 3 Vishy Ramaswamy CLA 2006-05-17 10:31:20 EDT
Committed the patch
Comment 4 Richard Gronback CLA 2008-08-13 13:05:03 EDT
[target cleanup] 1.0 RC3 was the original target milestone for this bug
Comment 5 Eclipse Webmaster CLA 2010-07-19 12:25:03 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug