Empty objects and arrays not handled correctly in results.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 3.0.0
    • Affects Version/s: 2.11.4
    • Component/s: BSON
    • None
    • Environment:
      Any
    • None
    • Major Change
    • None
    • None
    • None
    • None
    • None
    • None

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

            Assignee:
            Jeffrey Yemin
            Reporter:
            Graham Thomson
            None
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: