Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-5629

MapMessage.getChar does not handle if the backing map contains String or UTF8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    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:

          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());
              }
          }
      

      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.

      Attachments

        Issue Links

          Activity

            People

              tabish Timothy A. Bish
              stolsvik Endre Stølsvik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: