From 9194c6e4e67a5559b4577c5b788aa0cbfcf9a3f4 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Thu, 3 Mar 2011 06:22:14 +0000 Subject: 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 --- .../qpid/client/message/AMQMessageDelegate_0_10.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'java/client') 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 props = new ArrayList(); + Map 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 -- cgit v1.2.1