You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Steve Lawrence (JIRA)" <ji...@apache.org> on 2019/02/25 14:59:00 UTC

[jira] [Created] (DAFFODIL-2075) dfdl:hexBinary does not correcty reduce xs:integer

Steve Lawrence created DAFFODIL-2075:
----------------------------------------

             Summary: dfdl:hexBinary does not correcty reduce xs:integer
                 Key: DAFFODIL-2075
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2075
             Project: Daffodil
          Issue Type: Bug
          Components: Back End
    Affects Versions: 2.3.0
            Reporter: Steve Lawrence
             Fix For: 2.4.0


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
{code}
dfdl:hexBinary(xs:integer(32768)))
{code}
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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)