Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDORevisionImpl.eIsSet() works incorrectly
[CDO] CDORevisionImpl.eIsSet() works incorrectly [message #426085] Tue, 16 December 2008 08:37 Go to next message
Saulius Tvarijonas is currently offline Saulius TvarijonasFriend
Messages: 34
Registered: July 2009
Member
Hi,

I am using CDO 2.0.0M3 build. I am using EObject.eIsSet() to check if
certain feature is set. It seems CDOObject always returns true, even if
there is no value set.
Debugging shows that eIsSet goes to CDORevisionImpl.eIsSet().
Implementation is:

public boolean isSet(CDOFeature feature)
{
return getValue(feature) != null;
}

It seems checking here is incorrect, because value is CDOIDNULLImpl
instance. If I use eGet() method, I get as expected null.

Is it normal behavior?

Regards,
Saulius
Re: [CDO] CDORevisionImpl.eIsSet() works incorrectly [message #426091 is a reply to message #426085] Tue, 16 December 2008 09:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6483
Registered: July 2009
Senior Member
Saulius,

It looks like a bug. More generally it seems that we should check
against the default value rather than against null.
Can you please file a bugzilla?

Cheers
/Eike

----
http://thegordian.blogspot.com



Saulius Tvarijonas schrieb:
> Hi,
>
> I am using CDO 2.0.0M3 build. I am using EObject.eIsSet() to check if
> certain feature is set. It seems CDOObject always returns true, even
> if there is no value set.
> Debugging shows that eIsSet goes to CDORevisionImpl.eIsSet().
> Implementation is:
>
> public boolean isSet(CDOFeature feature)
> {
> return getValue(feature) != null;
> }
>
> It seems checking here is incorrect, because value is CDOIDNULLImpl
> instance. If I use eGet() method, I get as expected null.
>
> Is it normal behavior?
>
> Regards,
> Saulius


Re: [CDO] CDORevisionImpl.eIsSet() works incorrectly [message #426105 is a reply to message #426091] Tue, 16 December 2008 14:23 Go to previous message
Saulius Tvarijonas is currently offline Saulius TvarijonasFriend
Messages: 34
Registered: July 2009
Member
Hi,

I registered bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258933

Regards,
Saulius

On 12/16/2008 11:45 AM, Eike Stepper wrote:
> Saulius,
>
> It looks like a bug. More generally it seems that we should check
> against the default value rather than against null.
> Can you please file a bugzilla?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Saulius Tvarijonas schrieb:
>> Hi,
>>
>> I am using CDO 2.0.0M3 build. I am using EObject.eIsSet() to check if
>> certain feature is set. It seems CDOObject always returns true, even
>> if there is no value set.
>> Debugging shows that eIsSet goes to CDORevisionImpl.eIsSet().
>> Implementation is:
>>
>> public boolean isSet(CDOFeature feature)
>> {
>> return getValue(feature) != null;
>> }
>>
>> It seems checking here is incorrect, because value is CDOIDNULLImpl
>> instance. If I use eGet() method, I get as expected null.
>>
>> Is it normal behavior?
>>
>> Regards,
>> Saulius
Previous Topic:Stateful vs Singleton
Next Topic:XML Validation
Goto Forum:
  


Current Time: Mon Feb 24 20:57:24 GMT 2020

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

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

Back to the top