EMF Change : referenceValue proxy not resolved [message #537716] |
Thu, 03 June 2010 12:55 |
Eclipse User |
|
|
|
Originally posted by: koen.yskout.cs.kuleuven.be
Hi,
I load a ChangeDescription from a file, and then resolve all proxies
using EcoreUtil.resolveAll. I notice that some proxy objects are not
resolved, namely the objects that are used in a change of a reference
value (modeled by feature referenceValue in FeatureChange).
I believe the cause is the basicGetReferenceValue() method in
FeatureChangeImpl; I think this method should use the
getFeature()-method instead of accessing the 'feature' field directly.
In the debugger I see that the feature field has not been initialized
yet when getReferenceValue is called; only the feature name has been
set. This causes basicGetReferenceValue to return null, and not the
actual object.
Is this a bug, or is there a deliberate reason for this?
Kind regards,
Koen
|
|
|
Re: EMF Change : referenceValue proxy not resolved [message #537765 is a reply to message #537716] |
Thu, 03 June 2010 14:46 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Koen,
Comments below.
Koen Yskout wrote:
> Hi,
>
> I load a ChangeDescription from a file, and then resolve all proxies
> using EcoreUtil.resolveAll. I notice that some proxy objects are not
> resolved, namely the objects that are used in a change of a reference
> value (modeled by feature referenceValue in FeatureChange).
>
> I believe the cause is the basicGetReferenceValue() method in
> FeatureChangeImpl; I think this method should use the
> getFeature()-method instead of accessing the 'feature' field directly.
> In the debugger I see that the feature field has not been initialized
> yet when getReferenceValue is called; only the feature name has been
> set. This causes basicGetReferenceValue to return null, and not the
> actual object.
>
> Is this a bug, or is there a deliberate reason for this?
>
Hmmm. I guess because of the order of the features, the feature feature
isn't resolved first... But basicGet methods shouldn't ever cause
proxies to resolve, so calling getFeature from there seems bad.
Probably getReferenceFeature itself should be calling getFeature to
ensure that the feature field is properly initialized and resolved. Can
you try that? Please open a bugzilla.
> Kind regards,
>
> Koen
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: EMF Change : referenceValue proxy not resolved [message #537987 is a reply to message #537765] |
Fri, 04 June 2010 11:53 |
Eclipse User |
|
|
|
Originally posted by: koen.yskout.cs.kuleuven.be
On closer inspection, the problem looks not so much related to proxy
resolution because getReferenceValue() simply returns null if 'feature'
has not yet been set.
I opened a bugzilla
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=315753) which contains a
test case and a workaround (calling getFeature() before
getReferenceValue()).
Koen
On 03/06/10 16:46, Ed Merks wrote:
> Koen,
>
> Comments below.
>
> Koen Yskout wrote:
>> Hi,
>>
>> I load a ChangeDescription from a file, and then resolve all proxies
>> using EcoreUtil.resolveAll. I notice that some proxy objects are not
>> resolved, namely the objects that are used in a change of a reference
>> value (modeled by feature referenceValue in FeatureChange).
>>
>> I believe the cause is the basicGetReferenceValue() method in
>> FeatureChangeImpl; I think this method should use the
>> getFeature()-method instead of accessing the 'feature' field directly.
>> In the debugger I see that the feature field has not been initialized
>> yet when getReferenceValue is called; only the feature name has been
>> set. This causes basicGetReferenceValue to return null, and not the
>> actual object.
>>
>> Is this a bug, or is there a deliberate reason for this?
>>
> Hmmm. I guess because of the order of the features, the feature feature
> isn't resolved first... But basicGet methods shouldn't ever cause
> proxies to resolve, so calling getFeature from there seems bad.
> Probably getReferenceFeature itself should be calling getFeature to
> ensure that the feature field is properly initialized and resolved. Can
> you try that? Please open a bugzilla.
>> Kind regards,
>>
>> Koen
>>
>>
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03611 seconds