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

          Hide
          Robbie Gemmell added a comment -

          Looks good except for the commit log having the wrong JIRA

          For anyone looking later, the fix was applied in this commit: http://svn.apache.org/viewvc?view=revision&revision=1291260

          Show
          Robbie Gemmell added a comment - Looks good except for the commit log having the wrong JIRA For anyone looking later, the fix was applied in this commit: http://svn.apache.org/viewvc?view=revision&revision=1291260
          Hide
          Rob Godfrey added a comment -

          Obviously while the correct action is to consolidate the 0-8 and 0-10 codepaths... we should just fix this bug in the meantime.

          robbie - can you review this small fix?

          Show
          Rob Godfrey added a comment - Obviously while the correct action is to consolidate the 0-8 and 0-10 codepaths... we should just fix this bug in the meantime. robbie - can you review this small fix?
          Hide
          Robbie Gemmell added a comment -

          Updating 'Fix For' to Unknown on issues not targeted for 0.8

          Show
          Robbie Gemmell added a comment - Updating 'Fix For' to Unknown on issues not targeted for 0.8

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development