You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Pavel Tupitsyn <pt...@gridgain.com> on 2015/11/05 09:12:41 UTC

IgniteAtomicReference, compareAndSet, and nulls

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

Re: IgniteAtomicReference, compareAndSet, and nulls

Posted by Artem Shutak <as...@gridgain.com>.
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 <pt...@gridgain.com>
wrote:

> Done: https://issues.apache.org/jira/browse/IGNITE-1863
>
> On Thu, Nov 5, 2015 at 4:49 PM, Vladimir Ozerov <vo...@gridgain.com>
> 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 <pt...@gridgain.com>
> > 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
>

Re: IgniteAtomicReference, compareAndSet, and nulls

Posted by Pavel Tupitsyn <pt...@gridgain.com>.
Done: https://issues.apache.org/jira/browse/IGNITE-1863

On Thu, Nov 5, 2015 at 4:49 PM, Vladimir Ozerov <vo...@gridgain.com>
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 <pt...@gridgain.com>
> 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

Re: IgniteAtomicReference, compareAndSet, and nulls

Posted by Vladimir Ozerov <vo...@gridgain.com>.
I believe this is bug. Could you please create a ticket for this?

On Thu, Nov 5, 2015 at 11:12 AM, Pavel Tupitsyn <pt...@gridgain.com>
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
>