Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 867C01836F for ; Thu, 25 Feb 2016 16:24:18 +0000 (UTC) Received: (qmail 1830 invoked by uid 500); 25 Feb 2016 16:24:18 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 1731 invoked by uid 500); 25 Feb 2016 16:24:18 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 1701 invoked by uid 99); 25 Feb 2016 16:24:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2016 16:24:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 13E932C1F56 for ; Thu, 25 Feb 2016 16:24:18 +0000 (UTC) Date: Thu, 25 Feb 2016 16:24:18 +0000 (UTC) From: "Ryan Blue (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AVRO-1799) java: GenericData.toString() mutates underlying ByteBuffer backed data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AVRO-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167388#comment-15167388 ] Ryan Blue commented on AVRO-1799: --------------------------------- Thanks for reviewing Greg! I've updated the test as you suggested and I'll merge this later today unless someone objects. > java: GenericData.toString() mutates underlying ByteBuffer backed data > ---------------------------------------------------------------------- > > Key: AVRO-1799 > URL: https://issues.apache.org/jira/browse/AVRO-1799 > Project: Avro > Issue Type: Bug > Components: java > Affects Versions: 1.8.0 > Reporter: Greg McNutt > Priority: Critical > > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)