[jboss-jira] [JBoss JIRA] Closed: (JBMESSAGING-1749) Support null values for javax.jms.MapMessage.setObject
Howard Gao (JIRA)
jira-events at lists.jboss.org
Fri Oct 30 02:42:05 EDT 2009
[ https://jira.jboss.org/jira/browse/JBMESSAGING-1749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard Gao closed JBMESSAGING-1749.
-----------------------------------
Resolution: Done
Assignee: (was: Howard Gao)
Done.
Documented in
2.3.3. mapmessage.support.null.object
> 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
> 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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list