diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2012-09-28 17:27:56 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2012-09-28 17:27:56 +0000 |
| commit | ebaaa29314fa067d80c3b3da3849e19b4cf2115d (patch) | |
| tree | 6766866783cd2c70f6170f352aa8f4423cd82c37 /qpid/java/client/src/main | |
| parent | fb6cfba978c4d175f66a0355c0e3c21aba318235 (diff) | |
| download | qpid-python-ebaaa29314fa067d80c3b3da3849e19b4cf2115d.tar.gz | |
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
Diffstat (limited to 'qpid/java/client/src/main')
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java | 3 | ||||
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedListMessage.java | 14 |
2 files changed, 2 insertions, 15 deletions
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()); - } - } - } } |
