From 97eabaa7419f61015067d6b3fc29c3317f795b9e Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Thu, 30 Nov 2006 12:50:35 +0000 Subject: QPID-139 When the custom headers are empty no field table would be created. This null value would cause problems for various methods in AbstractJMSMessage. Simply create an empty FieldTable to save handling the null value. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@480912 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/framing/BasicContentHeaderProperties.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java index 3c7e656053..e337e9fd05 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java @@ -241,7 +241,7 @@ public class BasicContentHeaderProperties implements ContentHeaderProperties } } } - + public void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size) throws AMQFrameDecodingException { @@ -402,6 +402,7 @@ public class BasicContentHeaderProperties implements ContentHeaderProperties decodeUpToContentType(); } } + public String getContentType() { decodeContentTypeIfNecessary(); @@ -431,6 +432,12 @@ public class BasicContentHeaderProperties implements ContentHeaderProperties public FieldTable getHeaders() { decodeHeadersIfNecessary(); + + if (_headers == null) + { + _headers = new FieldTable(); + } + return _headers; } @@ -587,6 +594,6 @@ public class BasicContentHeaderProperties implements ContentHeaderProperties public String toString() { - return "reply-to = " + _replyTo + " propertyFlags = " + _propertyFlags; + return "reply-to = " + _replyTo + " propertyFlags = " + _propertyFlags; } } -- cgit v1.2.1