From ebaaa29314fa067d80c3b3da3849e19b4cf2115d Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Fri, 28 Sep 2012 17:27:56 +0000 Subject: QPID-3906 Switched the default to legacy stream message format. Allows the lists to contain elements of different types. Added a set of unit tests in place of the system tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1391566 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpid/client/AMQConnection.java | 3 ++- .../apache/qpid/client/message/AMQPEncodedListMessage.java | 14 -------------- 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'qpid/java/client/src/main') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java index 6758c2bf1e..6f2631ac05 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java @@ -306,7 +306,8 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect else { // use the default value set for all connections - _useLegacyStreamMessageFormat = Boolean.getBoolean(ClientProperties.USE_LEGACY_STREAM_MESSAGE_FORMAT); + _useLegacyStreamMessageFormat = System.getProperty(ClientProperties.USE_LEGACY_STREAM_MESSAGE_FORMAT) == null ? + true : Boolean.getBoolean(ClientProperties.USE_LEGACY_STREAM_MESSAGE_FORMAT); } String amqpVersion = System.getProperty((ClientProperties.AMQP_VERSION), "0-10"); diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedListMessage.java b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedListMessage.java index a6802c8dec..1d2cb43322 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedListMessage.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedListMessage.java @@ -91,7 +91,6 @@ public class AMQPEncodedListMessage extends JMSStreamMessage implements { checkWritable(); checkAllowedValue(a); - checkIfElementIsOfCorrectType(a); try { return _list.add(a); @@ -933,17 +932,4 @@ public class AMQPEncodedListMessage extends JMSStreamMessage implements { return _list; } - - private void checkIfElementIsOfCorrectType(Object obj) throws JMSException - { - if (!_list.isEmpty()) - { - if (obj.getClass() != _list.get(0).getClass()) - { - throw new MessageFormatException("List can only contain elements of the same type."+ - " The first element of the list is of type " + _list.get(0).getClass() + - " ,while the element suplied here is of type " + obj.getClass()); - } - } - } } -- cgit v1.2.1