Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1106

Empty objects and arrays not handled correctly in results.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 3.0.0
    • 2.11.4
    • BSON
    • None
    • Any
    • Major Change

    Description

      Values in an object returned from a query may be an empty object or an empty array.

      If such cases, calling bo.keySet().isEmpty() always returns false (the result is hardwired in the method override), depsite the fact that bo.keySet().size() == 0.

      A simple fix is to change the org.bson.util.StringRangeSet.isEmpty() implementation to:

      @Override
      public boolean isEmpty()

      { return size == 0; }

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            g-r-t Graham Thomson
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: