Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 203426 - EContentAdapter resolve instances of our Resource
Summary: EContentAdapter resolve instances of our Resource
Status: CLOSED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-14 06:59 EDT by Simon Mc Duff CLA
Modified: 2010-06-29 09:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Mc Duff CLA 2007-09-14 06:59:35 EDT
testCase is in CVS in (InitialTest)

Created an attachment (id=78395) [details]
TestCase - EContentAdapter

My test case shows that when we call 

resource.eAdapters().add( contentAdapter );

It will load objects contains by the resource.

But I`ve been notified!!

The expected behavior would be not to load any objects.

After calling 

Supplier supplier = (Supplier)transaction.getObject(supplierID);

the adapter should be added at this point automatically.

So I imagine that the only way to fix that problem using adapter would be to
override some method... 
Even if I put adapter on each on them.... I found that I will have some
overhead with this approach.. knowing I play with millions of objects... :-(

------- Comment #61 From Eike Stepper 2007-09-14 05:00:00 -0400 [reply] ------- 
 (In reply to comment #60)

 I've committed your test case and I can see the point.
 This is certainly not what one would expect.

 There's a line (427) in EContentsEList:
                 if (isIncluded(feature) && (!useIsSet() ||
eObject.eIsSet(feature)))
 where eIsSet() leads to LoadRevisionRequest in the end.
 I'm currently not sure what to do here.
 I'm a bit surprised that  this code is called although you have overridden
resolve() in your adapter.
 Can you please file a separate bug so that I don't forget about it?
Comment 1 Eike Stepper CLA 2007-09-15 02:41:06 EDT
Simon, I've added/implemented bug# 203511 to provide CDOTransactionHandlers. 
You're already in the CC.
Comment 2 Eike Stepper CLA 2007-09-15 12:59:38 EDT
In org.eclipse.emf.ecore.util.EContentsEList.FeatureIteratorImpl.hasNext() there's the following line:
Object value = eObject.eGet(feature, resolve());

Tracing into this call I come to
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateMany.dynamicGet(InternalEObject, DynamicValueHolder, int, boolean, boolean)
which calls org.eclipse.emf.internal.cdo.CDOObjectImpl.dynamicGet(int)
but the resolve flag gets lost on this way. I have no way to determine whether to resolve in dynamicGet().

I'm currently not sure what to do.
In the case you're happy with the new CDOTransactionHandler I'm tempted to close this bug with WONTFIX in favour to more important things. Of course it could be reopened later...
Comment 3 Ed Merks CLA 2007-09-15 14:14:30 EDT
For the case of a multi-valued feature, dynamicGet returns the whole list and only when you fetch things from that list should you have to decide whether to resolve the proxy for the particular list item you fetch.  So eGet for a many valued feature returns the same list regardless of the resolve argument.
Comment 4 Eike Stepper CLA 2007-09-17 13:06:36 EDT
I'm currently not sure what to do.
Closing this bug with WONTFIX in favour to more important things. 
Of course it could be reopened later...
Comment 5 Eike Stepper CLA 2008-06-10 02:29:12 EDT
Reversioned due to graduation
Comment 6 Eike Stepper CLA 2010-06-29 04:43:40 EDT
Closing