diff options
author | Martin Ritchie <ritchiem@apache.org> | 2006-11-30 12:50:35 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2006-11-30 12:50:35 +0000 |
commit | 97eabaa7419f61015067d6b3fc29c3317f795b9e (patch) | |
tree | 6cc107cd6d4e83f750e760bf670e87a912fa5828 | |
parent | 070bdc70d4076677a5f8574b4baafd4f49a01f35 (diff) | |
download | qpid-python-97eabaa7419f61015067d6b3fc29c3317f795b9e.tar.gz |
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
-rw-r--r-- | java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java | 11 |
1 files changed, 9 insertions, 2 deletions
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; } } |