Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1589

[Java] ReflectData.AllowNulls will create incompatible Schemas for primitive types

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.7
    • Fix Version/s: 1.8.0
    • Component/s: java
    • Labels:
      None

      Description

      ReflectData.AllowNulls will always create nullable types, even if the reflected object has primitive fields. When assigning a null to a primitive field, Java always throws a NullPointerException. I think the right thing to do is to allow nulls for any Object and return required schemas for primitive types.

        Attachments

        1. AVRO-1589-2.patch
          5 kB
          Ryan Blue
        2. AVRO-1589-1.patch
          1 kB
          Ryan Blue

          Issue Links

            Activity

              People

              • Assignee:
                rdblue Ryan Blue
                Reporter:
                rdblue Ryan Blue
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: