Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2770

AMQMessageDelegate_0_10 uses Byte.valueOf() when converting String properties to short, int, and long values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • M4, 0.5, 0.6, 0.14
    • 0.15
    • JMS AMQP 0-x
    • None

    Description

      AMQMessageDelegate_0_10 uses Byte.valueOf() when converting String properties to short, int, and long values. When setStringProperty() is used to to set a value and this is to be retrieved via getShortProperty(), getIntProperty(), getLongProperty() methods then the conversion is delegated to the next lowest property type and eventually to the getByteProperty() method and is thus likely not to function correctly.

      Each of the short, int, and long property retrieval methods should directly convert the String instead of delegating to the lower property method.

      Eg, getLongProperty which delegates the String to getIntProperty, which delegates it to getShortProperty() and eventually getByteProperty():

      if(o instanceof Long)

      { return ((Long)o).longValue(); }

      else
      {
      try

      { return Long.valueOf(getIntProperty(propertyName)); }

      Attachments

        Issue Links

          Activity

            People

              robbie Robbie Gemmell
              robbie Robbie Gemmell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: