Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7204

Unexpected behavior if passing null to binaryObject.field method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3
    • Fix Version/s: 2.9
    • Component/s: None
    • Labels:

      Description

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

      If not, an AssertionError will be thrown.

      Reproducer:

      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();
              }
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dmitryvinn Dmitry Vinnik
                Reporter:
                ascherbakov Alexey Scherbakov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: