Qpid
  1. Qpid
  2. QPID-2770

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: M4, 0.5, 0.6, 0.14
    • Fix Version/s: 0.15
    • Component/s: Java Client
    • Labels:
      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)); }

        Issue Links

          Activity

            People

            • Assignee:
              Robbie Gemmell
              Reporter:
              Robbie Gemmell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development