You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Norman Maurer (JIRA)" <ji...@apache.org> on 2010/11/15 13:51:24 UTC

[jira] Created: (AMQ-3037) ActiveMQMapMessage.getInt(..) does work with Long values

ActiveMQMapMessage.getInt(..) does work with Long values
--------------------------------------------------------

                 Key: AMQ-3037
                 URL: https://issues.apache.org/activemq/browse/AMQ-3037
             Project: ActiveMQ
          Issue Type: Bug
         Environment: Current trunk
            Reporter: Norman Maurer


When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception 

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


[jira] Commented: (AMQ-3037) ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63360#action_63360 ] 

Timothy Bish commented on AMQ-3037:
-----------------------------------

This is the correct behaviour as defined in the JMS Spec.  Here is the conversion table from the MapMessage JMS API docs, if you look on the left hand side and trace across you see that the only conversions allowed per the spec are long and string.

{noformat}

A value written as the row type can be read as the column type. 

 |        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
 |boolean |    X                                            X
 |byte    |          X     X         X   X                  X
 |short   |                X         X   X                  X
 |char    |                     X                           X
 |int     |                          X   X                  X
 |long    |                              X                  X
 |float   |                                    X     X      X
 |double  |                                          X      X
 |String  |    X     X     X         X   X     X     X      X
 |byte[]  |                                                        X
 |----------------------------------------------------------------------
 
{noformat}


> ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-3037
>                 URL: https://issues.apache.org/activemq/browse/AMQ-3037
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: Current trunk
>            Reporter: Norman Maurer
>         Attachments: AMQ-3037.diff
>
>
> When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception.
> Exceptions is;
> javax.jms.MessageFormatException:  cannot read an int from java.lang.Long
> 	at org.apache.activemq.command.ActiveMQMapMessage.getInt(ActiveMQMapMessage.java:320)

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


[jira] Resolved: (AMQ-3037) ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long

Posted by "Norman Maurer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer resolved AMQ-3037.
--------------------------------

    Resolution: Working as Designed

Hi Tim,

you are right.. I should have took a closer look at the spec..
Sorry for the noise.

> ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-3037
>                 URL: https://issues.apache.org/activemq/browse/AMQ-3037
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: Current trunk
>            Reporter: Norman Maurer
>         Attachments: AMQ-3037.diff
>
>
> When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception.
> Exceptions is;
> javax.jms.MessageFormatException:  cannot read an int from java.lang.Long
> 	at org.apache.activemq.command.ActiveMQMapMessage.getInt(ActiveMQMapMessage.java:320)

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


[jira] Updated: (AMQ-3037) ActiveMQMapMessage.getInt(..) does work with Long values

Posted by "Norman Maurer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer updated AMQ-3037:
-------------------------------

    Attachment: AMQ-3037.diff

Fix with unit-test ..

> ActiveMQMapMessage.getInt(..) does work with Long values
> --------------------------------------------------------
>
>                 Key: AMQ-3037
>                 URL: https://issues.apache.org/activemq/browse/AMQ-3037
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: Current trunk
>            Reporter: Norman Maurer
>         Attachments: AMQ-3037.diff
>
>
> When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception 

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


[jira] Updated: (AMQ-3037) ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long

Posted by "Norman Maurer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer updated AMQ-3037:
-------------------------------

    Description: 
When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception.

Exceptions is;
javax.jms.MessageFormatException:  cannot read an int from java.lang.Long
	at org.apache.activemq.command.ActiveMQMapMessage.getInt(ActiveMQMapMessage.java:320)


  was:When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception 

        Summary: ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long  (was: ActiveMQMapMessage.getInt(..) does work with Long values)

> ActiveMQMapMessage.getInt(..) does throw an Exception when try to access Long
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-3037
>                 URL: https://issues.apache.org/activemq/browse/AMQ-3037
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: Current trunk
>            Reporter: Norman Maurer
>         Attachments: AMQ-3037.diff
>
>
> When use a ActiveMQMapMessage.setLong("key", 200) and then use ActiveMQMapMessage.getInt("key") it will throw an Exception.
> Exceptions is;
> javax.jms.MessageFormatException:  cannot read an int from java.lang.Long
> 	at org.apache.activemq.command.ActiveMQMapMessage.getInt(ActiveMQMapMessage.java:320)

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