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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: Codecs
    • Labels:
      None
    • Sprint:
      JVM Sprint 38

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: