Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2075

dfdl:hexBinary does not correcty reduce xs:integer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • Back End
    • None

    Description

      When the parameter to dfdl:hexBInary is an xs:integer, it is supposed to create 1, 2, 4, or 8 bytes based on the value of the xs:integer. But if the value is greater than Short.MaxValue, it uses 8 bytes, regardless if it would fit in 4 bytes.

      For example

      dfdl:hexBinary(xs:integer(32768)))
      

      returns 0000000000008000 but should return 00008000. It looks like the reduce function in XSHexBinary.scala does the right thing to reduce the value to an Integer, but then the wrong toHexBinary function is called in HexBinaryConversions.scala.

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: