Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » unary reference f, fESet=true, despite setting feature to null, is this correct?
unary reference f, fESet=true, despite setting feature to null, is this correct? [message #958621] Fri, 26 October 2012 00:59 Go to next message
Philipp W. Kutter is currently offline Philipp W. Kutter
Messages: 301
Registered: July 2009
Senior Member
I a unary reference f, the generated code for the setter includes

fESet=true

even if I am setting the feature to null, is this correct?

I would expect:

if (oldF!=null) {fESet=true}


Regards, Philipp



*Philipp W. Kutter
*CEO, Dr. sc. ETH*
* Montages AG
Stampfenbachstr. 48
CH-8006 Zürich

tel: +41 44 260 75 57
mob: +41 79 338 06 17
web: *www.montages.com*
<http://www.linkedin.com/in/kutter>

Get a signature like this.
<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
Click here.
<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
Re: unary reference f, fESet=true, despite setting feature to null, is this correct? [message #958635 is a reply to message #958621] Fri, 26 October 2012 01:14 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Philipp,

Comments below.

On 26/10/2012 6:59 AM, Philipp W. Kutter | Montages AG wrote:
> I a unary reference f, the generated code for the setter includes
>
> fESet=true
>
> even if I am setting the feature to null, is this correct?
Yes, there is always one bit of additional state information associated
with an unsettable feature, i.e., the state of being used. This state
is always in addition of the value the feature has while in the state of
being set or uset.
>
> I would expect:
>
> if (oldF!=null) {fESet=true}
No, then a feature could not be considered set when set to null and
therefore we'd not be able to represent <feature xsi:nil="true/> as
being detectably different from the absence of that element from the XML
leaving us able to preserve this information upon reserialization.
>
>
> Regards, Philipp
>
>
>
> *Philipp W. Kutter
> *CEO, Dr. sc. ETH*
> * Montages AG
> Stampfenbachstr. 48
> CH-8006 Zürich
>
> tel: +41 44 260 75 57
> mob: +41 79 338 06 17
> web: *www.montages.com*
> <http://www.linkedin.com/in/kutter>
>
> Get a signature like this.
> <http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
> Click here.
> <http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
>
>
Previous Topic:EMF Enum editing
Next Topic:How to set a default value of an attribute in a subclass?
Goto Forum:
  


Current Time: Sat Aug 30 18:42:05 EDT 2014

Powered by FUDForum. Page generated in 0.01619 seconds