[jboss-jira] [JBoss JIRA] Created: (JBMESSAGING-1749) Support null values for javax.jms.MapMessage.setObject

Justin Bertram (JIRA) jira-events at lists.jboss.org
Thu Oct 22 15:53:18 EDT 2009


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.6.GA, 1.4.0.SP3.CP09
            Reporter: Justin Bertram
            Assignee: Howard Gao
             Fix For: 1.4.0.SP3.CP10, 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.");

   }

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