diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-03-03 06:22:14 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-03-03 06:22:14 +0000 |
commit | 9194c6e4e67a5559b4577c5b788aa0cbfcf9a3f4 (patch) | |
tree | 67e8f1db37cb3b7cb8c4dcb47f8b549fe1069a8a /java | |
parent | 574bb9a5d4bef4a3beff214f0c3a38827bd8c171 (diff) | |
download | qpid-python-9194c6e4e67a5559b4577c5b788aa0cbfcf9a3f4.tar.gz |
QPID-2930
The getPropertyNames method will filter out any property names whose values are not allowed as per the JMS spec.
I could have used the ALLOWED map to check if a value is a valid type.
But unfortunately that map contains byte[] as a valid type, which is not correct as per the JMS spec.
I did not want to modify that map or the behaviour of the setObjectProperty or getObjectProperty methods as there might be applications out there that is depending on it.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1076532 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java b/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java index 92e61984d2..fb7b191656 100644 --- a/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java +++ b/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java @@ -22,10 +22,12 @@ package org.apache.qpid.client.message; import java.lang.ref.SoftReference; +import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; @@ -670,7 +672,19 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate public Enumeration getPropertyNames() throws JMSException { - return java.util.Collections.enumeration(getApplicationHeaders().keySet()); + List<String> props = new ArrayList<String>(); + Map<String, Object> propertyMap = getApplicationHeaders(); + for (String prop: getApplicationHeaders().keySet()) + { + Object value = propertyMap.get(prop); + if (value instanceof Boolean || value instanceof Number + || value instanceof String) + { + props.add(prop); + } + } + + return java.util.Collections.enumeration(props); } public void setBooleanProperty(String propertyName, boolean b) throws JMSException |