summaryrefslogtreecommitdiff
path: root/qpid/java/common/src
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2006-11-30 12:50:35 +0000
committerMartin Ritchie <ritchiem@apache.org>2006-11-30 12:50:35 +0000
commit134d9096c6b3db69c390df05032de6e1f34e0ebc (patch)
tree3189fb93ec0b1271b90ce59bcef25bab283dca87 /qpid/java/common/src
parent8e3f38d770124d69b35ced7035068636de9b1783 (diff)
downloadqpid-python-134d9096c6b3db69c390df05032de6e1f34e0ebc.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@480912 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src')
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
index 3c7e656053..e337e9fd05 100644
--- a/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
+++ b/qpid/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;
}
}