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

Determine handling of null values when decoding back in to primitive types

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.0
    • Affects Version/s: None
    • Component/s: Codecs
    • Labels:
      None

      Rescoping to provide meaningful error messages when data is found for a field that does not match the expected type.

      Rather than throwing a generic error:

      org.bson.BsonInvalidOperationException: readBoolean can only be called when CurrentBSONType is BOOLEAN, not when CurrentBSONType is NULL.

      Wrap the exception and also provide information on what the name of the field that failed.

      Was:
      Determine handling of null values when decoding back in to primitive types

      When decoding in to Java objects with primitives, we need to decide if we're going to actively set those primitives to their 0 values or not set the field at all let any initialization in the class take care of it.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            justin.lee Justin Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: