You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Gary Tully (JIRA)" <ji...@apache.org> on 2008/09/08 16:55:56 UTC

[jira] Updated: (AMQ-1282) Bad conversion of nonexistent data in MapMessage

     [ https://issues.apache.org/activemq/browse/AMQ-1282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully updated AMQ-1282:
----------------------------

    Fix Version/s: 5.3.0
                       (was: 5.2.0)

> Bad conversion of nonexistent data in MapMessage
> ------------------------------------------------
>
>                 Key: AMQ-1282
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1282
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 4.1.1
>            Reporter: Elliotte Rusty Harold
>             Fix For: 5.3.0
>
>         Attachments: MapMessageTest.java
>
>
> Consider simple reception code like this:
>         MapMessage message = (MapMessage) consumer.receive(1000);
>         int x = message.getInt("foo"));
> I notice that x is now set to zero even though there was no "foo" value in the map. I would have expected an exception.
> According to Gaurav Hariani <ga...@blackspark.com> 	
> also from the spec api: http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MapMessage.html
>     Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value. Since char does not support a String conversion, attempting to read a null value as a char must throw a NullPointerException.
> .. so you are right that it is a bug ... since Integer.valueOf(null) throws an Exception

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.