diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2015-02-20 20:36:14 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2015-02-20 20:36:14 +0000 |
| commit | 09e4929f78d29253d1f1baa5c8d1bb4714b9f6b9 (patch) | |
| tree | 6c2bca10851c364fcc039540e4af87786855cf34 /qpid/java | |
| parent | e0847efda62214c70e279afac13389743cce7834 (diff) | |
| download | qpid-python-09e4929f78d29253d1f1baa5c8d1bb4714b9f6b9.tar.gz | |
QPID-6404 : [AMQP 1.0 JMS Client ] session.createMessage() should not attempt to create a message with no body sections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1661212 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java index d780c67a76..9d0ebc1474 100644 --- a/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java +++ b/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/AmqpMessageImpl.java @@ -26,8 +26,10 @@ import java.util.List; import java.util.ListIterator; import org.apache.qpid.amqp_1_0.jms.AmqpMessage; +import org.apache.qpid.amqp_1_0.type.Binary; import org.apache.qpid.amqp_1_0.type.Section; import org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties; +import org.apache.qpid.amqp_1_0.type.messaging.Data; import org.apache.qpid.amqp_1_0.type.messaging.DeliveryAnnotations; import org.apache.qpid.amqp_1_0.type.messaging.Footer; import org.apache.qpid.amqp_1_0.type.messaging.Header; @@ -36,6 +38,8 @@ import org.apache.qpid.amqp_1_0.type.messaging.Properties; public class AmqpMessageImpl extends MessageImpl implements AmqpMessage { + private static final List<Section> EMPTY_MESSAGE = + Collections.<Section>singletonList(new Data(new Binary(new byte[0]))); private List<Section> _sections; protected AmqpMessageImpl(Header header, @@ -57,7 +61,7 @@ public class AmqpMessageImpl extends MessageImpl implements AmqpMessage new DeliveryAnnotations(new HashMap()), new MessageAnnotations(new HashMap()), new Properties(), new ApplicationProperties(new HashMap()), new Footer(Collections.EMPTY_MAP), session); - _sections = new ArrayList<Section>(); + _sections = EMPTY_MESSAGE; } public int getSectionCount() |
