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

          Robbie Gemmell created issue -
          Robbie Gemmell made changes -
          Field Original Value New Value
          Link This issue is related to QPID-2776 [ QPID-2776 ]
          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
          Robbie Gemmell made changes -
          Fix Version/s 0.7 [ 12314455 ]
          Rajith Attapattu made changes -
          Assignee Rajith Attapattu [ rajith ]
          Rob Godfrey made changes -
          Assignee Rajith Attapattu [ rajith ] Rob Godfrey [ rgodfrey ]
          Rob Godfrey made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Rob Godfrey made changes -
          Status In Progress [ 3 ] Ready To Review [ 10006 ]
          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?
          Rob Godfrey made changes -
          Assignee Rob Godfrey [ rgodfrey ] Robbie Gemmell [ gemmellr ]
          Rob Godfrey made changes -
          Fix Version/s 0.15 [ 12319043 ]
          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
          Robbie Gemmell made changes -
          Status Ready To Review [ 10006 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Robbie Gemmell made changes -
          Affects Version/s 0.14 [ 12316855 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          572d 2h 42m 1 Rob Godfrey 20/Feb/12 13:57
          In Progress In Progress Reviewable Reviewable
          9s 1 Rob Godfrey 20/Feb/12 13:58
          Reviewable Reviewable Resolved Resolved
          23m 24s 1 Robbie Gemmell 20/Feb/12 14:21

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development