You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (JIRA)" <ji...@apache.org> on 2015/11/05 14:55:27 UTC

[jira] [Updated] (IGNITE-1863) IgniteAtomicReference.compareAndSet does not work for nulls

     [ https://issues.apache.org/jira/browse/IGNITE-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel  Tupitsyn updated IGNITE-1863:
------------------------------------
    Description: 
IgniteAtomicReference allows null as a value, but when current value is null, compareAndSet does not work:

{code}
        IgniteAtomicReference<String> atomic = ignite.atomicReference(atomicName, null, true);

        assertEquals(null, atomic.get());

        boolean res = atomic.compareAndSet(null, "x");

        assertTrue(res);                    // fail
        assertEquals("x", atomic.get());    // fail

{code}

  was:
IgniteAtomicReference allows null as a value, but when current value is null, compareAndSet does not work:

{code}
        IgniteAtomicReference<String> atomic = ignite.atomicReference(atomicName, null, true);

        assertEquals(null, atomic.get());

        boolean res = atomic.compareAndSet(null, "x");

        assertEquals(null, atomic.get());   // ok
        assertTrue(res);                    // fail
        assertEquals("x", atomic.get());    // fail

{code}


> IgniteAtomicReference.compareAndSet does not work for nulls
> -----------------------------------------------------------
>
>                 Key: IGNITE-1863
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1863
>             Project: Ignite
>          Issue Type: Bug
>          Components: data structures
>    Affects Versions: 1.5
>            Reporter: Pavel  Tupitsyn
>             Fix For: 1.5
>
>
> IgniteAtomicReference allows null as a value, but when current value is null, compareAndSet does not work:
> {code}
>         IgniteAtomicReference<String> atomic = ignite.atomicReference(atomicName, null, true);
>         assertEquals(null, atomic.get());
>         boolean res = atomic.compareAndSet(null, "x");
>         assertTrue(res);                    // fail
>         assertEquals("x", atomic.get());    // fail
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)