activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre Stølsvik (JIRA) <j...@apache.org>
Subject [jira] [Updated] (AMQ-5629) MapMessage.getChar does not handle if the backing map contains String or UTF8
Date Tue, 03 Mar 2015 13:48:04 GMT

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

Endre Stølsvik updated AMQ-5629:
--------------------------------
    Description: 
Compare to AMQ-5628.

Read up on http://docs.oracle.com/javaee/1.4/api/javax/jms/MapMessage.html to see that getChar(key)
shall be able to compute for something that was stored as a String.

ActiveMQMapMessage, line ~312:

{code}
    public char getChar(String name) throws JMSException {
        initializeReading();
        Object value = map.get(name);
        if (value == null) {
            throw new NullPointerException();
        }
        if (value instanceof Character) {
            return ((Character)value).charValue();
        } else {
            throw new MessageFormatException(" cannot read a short from " + value.getClass().getName());
        }
    }
{code}

Notice the absent handling of String or UTF8Buffer.

Notice ALSO the wrong wording in the Exception "cannot read SHORT from.." when we're in the
CHAR getter.

  was:
Compare to AMQ-5628.

Read up on http://docs.oracle.com/javaee/1.4/api/javax/jms/MapMessage.html to see that getChar(key)
shall be able to compute for something that was stored as a String.

ActiveMQMapMessage, line

{code}
    public char getChar(String name) throws JMSException {
        initializeReading();
        Object value = map.get(name);
        if (value == null) {
            throw new NullPointerException();
        }
        if (value instanceof Character) {
            return ((Character)value).charValue();
        } else {
            throw new MessageFormatException(" cannot read a short from " + value.getClass().getName());
        }
    }
{code}

Notice the absent handling of String or UTF8Buffer.

Notice ALSO the wrong wording in the Exception "cannot read SHORT from.." when we're in the
CHAR getter.


> MapMessage.getChar does not handle if the backing map contains String or UTF8
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-5629
>                 URL: https://issues.apache.org/jira/browse/AMQ-5629
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Endre Stølsvik
>
> Compare to AMQ-5628.
> Read up on http://docs.oracle.com/javaee/1.4/api/javax/jms/MapMessage.html to see that
getChar(key) shall be able to compute for something that was stored as a String.
> ActiveMQMapMessage, line ~312:
> {code}
>     public char getChar(String name) throws JMSException {
>         initializeReading();
>         Object value = map.get(name);
>         if (value == null) {
>             throw new NullPointerException();
>         }
>         if (value instanceof Character) {
>             return ((Character)value).charValue();
>         } else {
>             throw new MessageFormatException(" cannot read a short from " + value.getClass().getName());
>         }
>     }
> {code}
> Notice the absent handling of String or UTF8Buffer.
> Notice ALSO the wrong wording in the Exception "cannot read SHORT from.." when we're
in the CHAR getter.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message