From 1c011779aca79765298d5b19bfef3fa0e8dcf48f Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Tue, 8 Dec 2009 11:38:46 +0000 Subject: QPID-2242 : Update to 0-8 producer to set the JMS_QPID_DESTTYPE when sending messages. This update required a change to the FieldTable to clear any _encodedBuffer when setting a new value Provided test in JMSDestintationTest. This test requires a broker that supports both 0-8/9 and 0-10 as we must first use a 0-10 connection to send a message, which does not set JMS_QPID_DESTTYPE, then receive the message on 0-8/9. This allows us to validate that messages recieved without JMS_QPID_DESTTYPE set will can correctly set the value without a BufferOverflow Exception when simply forwarding the message. Excluded test from all cpp and InVM runs as test requires a 0-8/9 and 0-10 capable broker. Can reinstate to InVM when multiprotocol testing is capable. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@888345 13f79535-47bb-0310-9956-ffa450edef68 --- java/common/src/main/java/org/apache/qpid/framing/FieldTable.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/common/src/main') diff --git a/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java b/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java index 9b2f9b3969..341238c667 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java +++ b/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java @@ -131,9 +131,10 @@ public class FieldTable } else if ((_encodedForm != null) && (val != null)) { - EncodingUtils.writeShortStringBytes(_encodedForm, key); - val.writeToBuffer(_encodedForm); - + // We have updated data to store in the buffer + // So clear the _encodedForm to allow it to be rebuilt later + // this is safer than simply appending to any existing buffer. + _encodedForm = null; } else if (val == null) { -- cgit v1.2.1