Bug 139049 - Runtime EMF API must be aware of cross-resource containment
Summary: Runtime EMF API must be aware of cross-resource containment
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Linux
: P2 major
Target Milestone: 1.0   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-04-27 15:25 EDT by Christian Damus CLA
Modified: 2010-07-19 12:24 EDT (History)
1 user (show)

See Also:


Attachments
Updates resulting from the sweep (9.99 KB, patch)
2006-04-27 15:46 EDT, Christian Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-04-27 15:25:47 EDT
The GMF Runtime EMF APIs must be aware of possible cross-resource containment structures in the models on which they operate.  The following plug-ins should be swept:

  - org.eclipse.gmf.runtime.emf.clipboard.core
  - org.eclipse.gmf.runtime.emf.core

to ensure that no assumptions are made about the object-resource relationships of any objects.  In particular, usages of the following APIs must be revisited:

EObject.eResource() - An EObject and its container do not necessarily have the same resource any more.

EObject.eContainer() - An EObject and its container do not necessarily have the same resource any more.

EObject.eContents() - May include objects from a different resource.

EObject.eAllContents() - May include objects from a different resource.

Resource.getContents() - May include children of objects from a different resource.

Resource.getAllContents() - May include objects from a different resource.
Comment 1 Christian Damus CLA 2006-04-27 15:46:26 EDT
Created attachment 39712 [details]
Updates resulting from the sweep

Attached a patch that addresses some assumptions about the object/resource relationships that are invalidated by cross-resource containment.  In particular:

  - update the clipboard saving resource to save cross-resource contained
    objects in situ, not as proxies
  - update the copying resource to correctly obtain the IDs of objects from
    the resources that actually contain them, and to correctly determine
    whether an object is in the resource being copied or any of its children
  - ensure that an object removed from its container is also removed from
    its resource, if they are in different resources

Also added some comments to explain why, in places, code that would resolve containment proxies is correct to do so.
Comment 2 Christian Damus CLA 2006-04-27 15:47:39 EDT
Adding Vishy to cc: to review and (hopefully) commit the patch.
Comment 3 Vishy Ramaswamy CLA 2006-04-27 20:28:03 EDT
Reviewed and applied patch
Comment 4 Richard Gronback CLA 2008-08-13 13:04:20 EDT
[target cleanup] 1.0 RC was the original target milestone for this bug
Comment 5 Eclipse Webmaster CLA 2010-07-19 12:24:35 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug