Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug with valueLength being overwritten after Trim #1338

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Nov 1, 2024

  1. Fix Bug with valueLength being overwritten after Trim

    - currently after trimming the value of the element, we set the valueLength, and then overwrite it after returning from the parse that does the trimming. This results in the wrong value for value length. This fixes it by checking if the valueLength has already been set, and only setting it in SpecifiedLengthParserBase.parse if it hasn't
    - add tests
    
    DAFFODIL-2658
    olabusayoT committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    15ba745 View commit details
    Browse the repository at this point in the history
  2. fixup! Fix Bug with valueLength being overwritten after Trim

    - update check to captureValueLength in base parser if it's a complex element
    - update shouldCaptureParseValueLength to use PrimType.String instead of representation Text, since strings valueLengths (and delimited valueLengths) are always handled by value parsers
    
    DAFFODIL-2658
    olabusayoT committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    bc68935 View commit details
    Browse the repository at this point in the history
  3. fixup! fixup! Fix Bug with valueLength being overwritten after Trim

    - add asserts to setAbsStartPos0bInBits and setAbsEndPos0bInBits to ensure they're not being overwritten
    - undo change to capturedByValueParsers to put back im[liedRepresentation == Text
    - do not capture the value lengths of choices in specified length parser base
    - fix bug where padding is being added around prefixed length element (DAFFODIL-2943) by changing CaptureLengthRegion to wrap around contentlengthStart and padding
    - fix bug where we use the valuelength to calculate the prefix length, according to the spec it should be the content length
    - fix bug where we were missing return after PE for Out of Range Binary Integers (DAFFODIL-2942)
    - fix bug where we were using the main element's qname instead of the prefixed element qname in the Unparse Error message
    - refactor Prefixed parsers to use state's bitLimit to get the prefix length (PrefixedLengthParserMixin2) since the specifiedLengthPrefixedParser will take care of parsing the prefix length
    - refactored Prefixed unparsers to not try to unparse prefix length since that is taken care of by SpecifiedLengthPrefixedUnparser
    - refactored prefixed parsers and unparsers to remove unused prefixed length parser related members
    
    DAFFODIL-2658
    olabusayoT committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    78050c8 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. fixup! fixup! fixup! Fix Bug with valueLength being overwritten after…

    … Trim
    
    - rename custom prefixedlength parsers to *BitLengthParsers to more accurately reflect what they're doing
    - rename custom prefixedlength unparsers to MinimumLengthUnparsers to more accurately reflect what they're doing
    - rename PrefixedLengthParserMixin2 to BitLengthFromBitLimitMixin to more accurately reflect what it is
    - got rid of HexBinaryLengthPrefixed since it is the same as HexBinaryEndOfBitLimit
    
    DAFFODIL-2658
    olabusayoT committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    ccdc433 View commit details
    Browse the repository at this point in the history