Unnecessary resetting of object references [message #114851] |
Sun, 16 March 2008 09:33  |
Eclipse User |
|
|
|
Hi Martin,
in the context of another problem I had with the generated gmf source (for
a detailed description look at my question in the gmf group) I discovered
that the EReferencePropertyHandler.set() does a reset of an object even if
the new object is the same as the old one.
If the reference is not bidirectional the current source lines are
if (curValue == null && value == null) {
return; // do nothing in this case
}
...
Could this be replaced by something like this
if (curValue == value) {
return; // do nothing in this case
}
...
without any harm?
Best regards
Manfred
|
|
|
Re: Unnecessary resetting of object references [message #114865 is a reply to message #114851] |
Sun, 16 March 2008 14:11  |
Eclipse User |
|
|
|
Hi Manfred,
Yes no problem, I will make the change. There will probably be a new build today. Btw, I also worked
on the GMF-teneo integration incl. persisting the diagram. I will probably publish a new tutorial
today also.
gr. Martin
Manfred Hahn wrote:
> Hi Martin,
>
> in the context of another problem I had with the generated gmf source
> (for a detailed description look at my question in the gmf group) I
> discovered that the EReferencePropertyHandler.set() does a reset of an
> object even if the new object is the same as the old one.
>
> If the reference is not bidirectional the current source lines are
> if (curValue == null && value == null) {
> return; // do nothing in this case
> }
> ...
>
> Could this be replaced by something like this
> if (curValue == value) {
> return; // do nothing in this case
> }
> ...
> without any harm?
>
> Best regards
>
> Manfred
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Unnecessary resetting of object references [message #615893 is a reply to message #114851] |
Sun, 16 March 2008 14:11  |
Eclipse User |
|
|
|
Hi Manfred,
Yes no problem, I will make the change. There will probably be a new build today. Btw, I also worked
on the GMF-teneo integration incl. persisting the diagram. I will probably publish a new tutorial
today also.
gr. Martin
Manfred Hahn wrote:
> Hi Martin,
>
> in the context of another problem I had with the generated gmf source
> (for a detailed description look at my question in the gmf group) I
> discovered that the EReferencePropertyHandler.set() does a reset of an
> object even if the new object is the same as the old one.
>
> If the reference is not bidirectional the current source lines are
> if (curValue == null && value == null) {
> return; // do nothing in this case
> }
> ...
>
> Could this be replaced by something like this
> if (curValue == value) {
> return; // do nothing in this case
> }
> ...
> without any harm?
>
> Best regards
>
> Manfred
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.06522 seconds