Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361362 - Derived, contained references are filtered from eContents
Summary: Derived, contained references are filtered from eContents
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 05:33 EDT by Sebastian Zarnekow CLA
Modified: 2011-11-22 05:26 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-10-19 05:33:02 EDT
Objects, that are created on demand and referenced by a derived, transient, containment are not part of the eContents list. This may lead to unexpected behavior, e.g. the diagnostician will not validate these objects. OTOH it is very convenient that eContents does not change when someone processes and object's contents and thereby transparently creates new contained instances. If these instances were part of eContents, a concurrent modification would occur.

Concrete use case in Xtext / Xbase:

XFeatureCall has something like #implicitReceiver and #implicitFirstArgument. Both may be initialized when #getFeature is called and resolves a cross references since the #implicits carry additional information about the reason why #getFeature resolves to a specific instance.
Comment 1 Ed Merks CLA 2011-10-27 04:39:51 EDT
I've changed it to filter out exactly for the same cases that non-containment references are filtered out for eCrossReferences.

As long as the derivation is done during the first get, this approach to derived containment should work well.  As long as no multi-valued feature's list is changing as we iterator over that specific list via eContents or eCrossReferences, we shouldn't see any concurrent modification issues.

The changes are committed to CVS for 2.8.
Comment 2 Ed Merks CLA 2011-11-22 05:26:32 EST
The changes are available in builds.