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

Alexei Scherbakov updated IGNITE-7204:
--------------------------------------
    Description: 
If assertions are disabled, when first field value will be returned.

If not, an AssertionError will be thrown.

Reproducer:

{noformat}
public void testNullField() throws Exception {
        try {
            final IgniteEx ex = startGrid(0);

            final IgniteCache<Integer, BinaryObject> test = 
ex.cache("test").withKeepBinary();

            final BinaryObjectBuilder bldr = ex.binary().builder("obj");

            bldr.setField("x", 1);

            test.put(0, bldr.build());

            test.query(new ScanQuery<>(new IgniteBiPredicate<Integer, 
BinaryObject>() {
                @Override public boolean apply(Integer o, BinaryObject o2) {
                    final Object q = o2.field(null);

                    return false;
                }
            })).getAll();
        }
        finally {
            stopAllGrids();
        }
    }
{noformat}

  was:
If assertions are disabled, when first field value will be returned.

If not, an AssertionError will be thrown.

Reproducer:

{noformat}
public void testNullField() throws Exception {
        try {
            final IgniteEx ex = startGrid(0);

            final IgniteCache<Integer, BinaryObject> test = 
ex.cache("test").withKeepBinary();

            final BinaryObjectBuilder bldr = ex.binary().builder("bldr");

            bldr.setField("x", 1);

            test.put(0, bldr.build());

            test.query(new ScanQuery<>(new IgniteBiPredicate<Integer, 
BinaryObject>() {
                @Override public boolean apply(Integer o, BinaryObject o2) {
                    final Object q = o2.field(null);

                    return false;
                }
            })).getAll();
        }
        finally {
            stopAllGrids();
        }
    }
{noformat}


> Unexpected behavior if passing null to binaryObject.field method
> ----------------------------------------------------------------
>
>                 Key: IGNITE-7204
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7204
>             Project: Ignite
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Alexei Scherbakov
>              Labels: newbie
>             Fix For: 2.4
>
>
> If assertions are disabled, when first field value will be returned.
> If not, an AssertionError will be thrown.
> Reproducer:
> {noformat}
> public void testNullField() throws Exception {
>         try {
>             final IgniteEx ex = startGrid(0);
>             final IgniteCache<Integer, BinaryObject> test = 
> ex.cache("test").withKeepBinary();
>             final BinaryObjectBuilder bldr = ex.binary().builder("obj");
>             bldr.setField("x", 1);
>             test.put(0, bldr.build());
>             test.query(new ScanQuery<>(new IgniteBiPredicate<Integer, 
> BinaryObject>() {
>                 @Override public boolean apply(Integer o, BinaryObject o2) {
>                     final Object q = o2.field(null);
>                     return false;
>                 }
>             })).getAll();
>         }
>         finally {
>             stopAllGrids();
>         }
>     }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to