Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4924

CLONE -ConverterUtil.compare fails for BigInteger values

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 1.5.4
    • 1.5.5
    • adb
    • None
    • Axis2 1.5.4, verified in source code

    Description

      Somehow the fix for AXIS2-4200 is not present in version 1.4.
      I have verified this in the source code released with 1.5.4.

      ---- AXIS2-4200 Copied description ----
      A range is defined as:

      <xs:restriction base="xs:integer">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="999999999999999"/>
      </xs:restriction>

      The generated databinding calls:

      public void setPhoneNumberType(java.math.BigInteger param){
      if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "999999999999999") <= 0)

      { this.localPhoneNumberType=param; }

      else

      { throw new java.lang.RuntimeException(); }

      The ConverterUtil code is:

      public static int compare(BigInteger binBigInteger, String value)

      { return binBigInteger.intValue() - Integer.parseInt(value); }

      This will always fail for values that exceed the capacity of a java.lang.Integer with:

      Caused by: java.lang.NumberFormatException: For input string: "999999999999999"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:459)
      at java.lang.Integer.parseInt(Integer.java:497)
      at org.apache.axis2.databinding.utils.ConverterUtil.compare(ConverterUtil.java:1281)
      [...]

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            spenk Henk Spaan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment