Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-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 AF52FDFD5 for ; Sat, 19 Jan 2013 22:12:14 +0000 (UTC) Received: (qmail 84077 invoked by uid 500); 19 Jan 2013 22:12:14 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 84026 invoked by uid 500); 19 Jan 2013 22:12:14 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 83976 invoked by uid 99); 19 Jan 2013 22:12:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2013 22:12:14 +0000 Date: Sat, 19 Jan 2013 22:12:14 +0000 (UTC) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQNET-404) ActiveMQByteMessage Content accessing multiple times wipes the property 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/AMQNET-404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558102#comment-13558102 ] Timothy Bish commented on AMQNET-404: ------------------------------------- Patch with unit tests welcomed. > ActiveMQByteMessage Content accessing multiple times wipes the property > ----------------------------------------------------------------------- > > Key: AMQNET-404 > URL: https://issues.apache.org/jira/browse/AMQNET-404 > Project: ActiveMQ .Net > Issue Type: Bug > Components: ActiveMQ > Affects Versions: 1.5.6 > Reporter: Daniel Marbach > Assignee: Jim Gomes > Priority: Minor > > If you have an IBytesMessage and for example do the following: > byte[] content = null; > if (message.Content!= null) > { > content = message.Content; > } > Accessing content the first time will return the correct data. > Accessing a second time the content property will return an empty byte array which has the length of the data but all bytes are zero. > It is OK that the content property is evaluated lazily but it should not return different data when accessing multiple times. So accessing the property the first time should read the buffer and assign it to a field and then always return that byte buffer. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira