Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1560

RoundTrip: SpecifiedLengthExplicitCharactersUnparserBase does not work with padding

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocking Blocking
    • 2.0.0
    • None
    • Unparsing
    • None

      When there is a specified length with lengthUnits="characters", the SpecifiedLengthExplicitCharactersUnparserBase doesn't handling padding. This is because what happens the unparser that handles padding (StringOfSpecifiedLength) uses bitLimit to determine how much padding to add. But the SpecifiedLengthExplicitCharactersUnparserBase creates a CharBufferDataOutputStream to write that characters. However, this output stream does not have a bitLimit (since chars could be variable width), and so the StringOfSpecifiedLengthUnparser does not know how much padding to add.

      Perhaps the padding logic needs to be done in the SpecifiedLengthExplicitCharactersUnparserBase class? So StringOfSpecifiedLength writes to a temporary char buffer and does not add padding because there is no bitLimit. Then the SpecifiedLength unparser can figure out how many characters to add based on that how many characters we're left unfilled?

      Note that this prevents test_simple_type_properties_pad_trim_13_04 in edu.illinois.ncsa.daffodil.IBMTestsThatPass from round tripping.

              dthompson David Thompson
              slawrence Steve Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: