Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Change : referenceValue proxy not resolved
EMF Change : referenceValue proxy not resolved [message #537716] Thu, 03 June 2010 12:55 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
>>
>>
>>
Re: EMF Change : referenceValue proxy not resolved [message #538262 is a reply to message #537987] Mon, 07 June 2010 07:08 Go to previous message
Cyril Jaquier is currently offline Cyril JaquierFriend
Messages: 80
Registered: July 2009
Member
Hi,

> 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 also faced the same issue (and used the same workaround). The
generated classes from the EMF Change Model are heavily modified.

I also had problems calling ChangeDescription#getObjectsToDetach() at
any time (e.g. if you load several change descriptions and want to dump
their content). It will most likely throw an exception because
getObjectsToDetach() calls preApply() which needs the model to be in the
"right" state (the state it was when the change description has been
created).

So take care when calling something else than apply() or
applyAndReverse() ;-)

Regards,
Cyril
Previous Topic:[CDO] General UI question EMF.Edit
Next Topic:File vs. platform URI in combination with ResourceSet
Goto Forum:
  


Current Time: Sat Sep 21 19:43:23 GMT 2024

Powered by FUDForum. Page generated in 0.03611 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top