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

java: GenericData.toString() mutates underlying ByteBuffer backed data

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.9.0
    • Component/s: java
    • Labels:
      None

      Description

      Around line 550, the writeEscapedString() method, used to serialize a byte array, will alter the underlying ByteBuffer's pointer. Meaning subsequent uses of a toString()'d avro object will yield different results.

      Need to not use a generic decode on a ByteBuffer; either clone the element (expensive), or iterate over the elements with an external index.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rdblue Ryan Blue
                Reporter:
                gcmcnutt Greg McNutt
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: