Cross reference adapter resolves proxy although it shouldn't? [message #1112467] |
Thu, 19 September 2013 18:58 |
Eclipse User |
|
|
|
Hi!
I am confused about a code fragment in
org.eclipse.emf.ecore.util.ECrossReferenceAdapter.getInverseReferences(EObject
eObject, boolean resolve):
Even if called with resolve = false, the following happens:
1. eObject.eContainer() is called
2. eContainer() calls: InternalEObject result = eInternalContainer();
3. since 'result' is a proxy, it calls: eResolveProxy(result);
Is that on purpose? I would have thought that in 1. instead of calling
'eContainer()' the cross reference adapter should rather call
'eInternalContainer()' to avoid proxy resolution.
Don't know whether it has side-effects.. but what about:
EObject eContainer = resolve ? eObject.eContainer() :
((BasicEObjectImpl)eObject).eInternalContainer();
Cheers
Patrick
|
|
|
|
Re: Cross reference adapter resolves proxy although it shouldn't? [message #1112785 is a reply to message #1112741] |
Fri, 20 September 2013 06:55 |
Eclipse User |
|
|
|
Ed,
thanks for the quick reply. Here's the bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=417667
Cheers
Patrick
Am 20.09.2013 07:17, schrieb Ed Merks:
> Patrick,
>
> That does seem inconsistent. Apparently it wasn't adjusted when proxy
> resolving containment/containers was added. Please open a bugzilla.
>
>
> On 19/09/2013 8:58 PM, Patrick Könemann wrote:
>> Hi!
>>
>> I am confused about a code fragment in
>> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.getInverseReferences(EObject
>>
>> eObject, boolean resolve):
>>
>> Even if called with resolve = false, the following happens:
>> 1. eObject.eContainer() is called
>> 2. eContainer() calls: InternalEObject result = eInternalContainer();
>> 3. since 'result' is a proxy, it calls: eResolveProxy(result);
>>
>> Is that on purpose? I would have thought that in 1. instead of calling
>> 'eContainer()' the cross reference adapter should rather call
>> 'eInternalContainer()' to avoid proxy resolution.
>>
>> Don't know whether it has side-effects.. but what about:
>> EObject eContainer = resolve ? eObject.eContainer() :
>> ((BasicEObjectImpl)eObject).eInternalContainer();
>>
>> Cheers
>> Patrick
>
|
|
|
Powered by
FUDForum. Page generated in 0.03004 seconds