IgniteAtomicReference, compareAndSet, and nulls

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

IgniteAtomicReference, compareAndSet, and nulls

Pavel Tupitsyn-3
Igniters,

Looks like GridCacheAtomicReferenceImpl.compareAndSet does not work with
nulls properly.
Null is a valid value for an atomic reference, but for a reference with a
null value
compareAndSet(null, x) returns false. See wrapperPredicate func (line 204).

Is this a bug or an expected behavior?

Thanks,

--
--
Pavel Tupitsyn
GridGain Systems, Inc.
www.gridgain.com
Reply | Threaded
Open this post in threaded view
|

Re: IgniteAtomicReference, compareAndSet, and nulls

Vladimir Ozerov
I believe this is bug. Could you please create a ticket for this?

On Thu, Nov 5, 2015 at 11:12 AM, Pavel Tupitsyn <[hidden email]>
wrote:

> Igniters,
>
> Looks like GridCacheAtomicReferenceImpl.compareAndSet does not work with
> nulls properly.
> Null is a valid value for an atomic reference, but for a reference with a
> null value
> compareAndSet(null, x) returns false. See wrapperPredicate func (line 204).
>
> Is this a bug or an expected behavior?
>
> Thanks,
>
> --
> --
> Pavel Tupitsyn
> GridGain Systems, Inc.
> www.gridgain.com
>
Reply | Threaded
Open this post in threaded view
|

Re: IgniteAtomicReference, compareAndSet, and nulls

Pavel Tupitsyn-3
Done: https://issues.apache.org/jira/browse/IGNITE-1863

On Thu, Nov 5, 2015 at 4:49 PM, Vladimir Ozerov <[hidden email]>
wrote:

> I believe this is bug. Could you please create a ticket for this?
>
> On Thu, Nov 5, 2015 at 11:12 AM, Pavel Tupitsyn <[hidden email]>
> wrote:
>
> > Igniters,
> >
> > Looks like GridCacheAtomicReferenceImpl.compareAndSet does not work with
> > nulls properly.
> > Null is a valid value for an atomic reference, but for a reference with a
> > null value
> > compareAndSet(null, x) returns false. See wrapperPredicate func (line
> 204).
> >
> > Is this a bug or an expected behavior?
> >
> > Thanks,
> >
> > --
> > --
> > Pavel Tupitsyn
> > GridGain Systems, Inc.
> > www.gridgain.com
> >
>



--
--
Pavel Tupitsyn
GridGain Systems, Inc.
www.gridgain.com
Reply | Threaded
Open this post in threaded view
|

Re: IgniteAtomicReference, compareAndSet, and nulls

Artem Shutak
Igniters,

I've assigned the ticket to yourself and already fixed it.

Will check TC (I believe the fix could not brake something) and will send
for review.

Thanks,
-- Artem --

On Thu, Nov 5, 2015 at 4:55 PM, Pavel Tupitsyn <[hidden email]>
wrote:

> Done: https://issues.apache.org/jira/browse/IGNITE-1863
>
> On Thu, Nov 5, 2015 at 4:49 PM, Vladimir Ozerov <[hidden email]>
> wrote:
>
> > I believe this is bug. Could you please create a ticket for this?
> >
> > On Thu, Nov 5, 2015 at 11:12 AM, Pavel Tupitsyn <[hidden email]>
> > wrote:
> >
> > > Igniters,
> > >
> > > Looks like GridCacheAtomicReferenceImpl.compareAndSet does not work
> with
> > > nulls properly.
> > > Null is a valid value for an atomic reference, but for a reference
> with a
> > > null value
> > > compareAndSet(null, x) returns false. See wrapperPredicate func (line
> > 204).
> > >
> > > Is this a bug or an expected behavior?
> > >
> > > Thanks,
> > >
> > > --
> > > --
> > > Pavel Tupitsyn
> > > GridGain Systems, Inc.
> > > www.gridgain.com
> > >
> >
>
>
>
> --
> --
> Pavel Tupitsyn
> GridGain Systems, Inc.
> www.gridgain.com
>