]
Tim Fox reopened JBMESSAGING-1749:
----------------------------------
Guys-
You can't change behaviour like this in a CP release as users might be relying on the
previous behaviour, and your changes might break their application
Support null values for javax.jms.MapMessage.setObject
------------------------------------------------------
Key: JBMESSAGING-1749
URL:
https://jira.jboss.org/jira/browse/JBMESSAGING-1749
Project: JBoss Messaging
Issue Type: Feature Request
Components: Messaging Core
Affects Versions: 1.4.0.SP3.CP09, 1.4.6.GA
Reporter: Justin Bertram
Assignee: Howard Gao
Fix For: 1.4.0.SP3.CP10, 1.4.6.GA.SP1, 1.4.7.GA
Our implementation of javax.jms.MapMessage is org.jboss.jms.message.JBossMapMessage. Its
setObject is:
public void setObject(String name, Object value) throws JMSException
{
checkName(name);
if (value instanceof Boolean)
((Map)getPayload()).put(name, value);
else if (value instanceof Byte)
((Map)getPayload()).put(name, value);
else if (value instanceof Short)
((Map)getPayload()).put(name, value);
else if (value instanceof Character)
((Map)getPayload()).put(name, value);
else if (value instanceof Integer)
((Map)getPayload()).put(name, value);
else if (value instanceof Long)
((Map)getPayload()).put(name, value);
else if (value instanceof Float)
((Map)getPayload()).put(name, value);
else if (value instanceof Double)
((Map)getPayload()).put(name, value);
else if (value instanceof String)
((Map)getPayload()).put(name, value);
else if (value instanceof byte[])
((Map)getPayload()).put(name, ((byte[]) value).clone());
else
throw new MessageFormatException("Invalid object type.");
}
Setting a null value will result in a MessageFormatException since instanceof returns
false on nulls. Although the JMS spec doesn't indicate its necessity, I think we
should support setting null values (e.g. javax.jms.MapMessage.setObject("name",
null)) as this is a convenience method support both by WebLogic and WebSphere.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: