You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Dave Thompson (Jira)" <ji...@apache.org> on 2022/02/28 14:59:00 UTC

[jira] [Reopened] (DAFFODIL-2657) prefixedLengthType which itself has lengthKind 'implict' fails with None.get

     [ https://issues.apache.org/jira/browse/DAFFODIL-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Thompson reopened DAFFODIL-2657:
-------------------------------------

> prefixedLengthType which itself has lengthKind 'implict' fails with None.get
> ----------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2657
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2657
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Middle &quot;End&quot;
>    Affects Versions: 3.2.1
>            Reporter: Mike Beckerle
>            Assignee: Mike Beckerle
>            Priority: Major
>             Fix For: 3.3.0
>
>
> When an element has prefixed lengthKind, prefixIncludesPrefixLength='yes' the prefixLengthKind itself is derived from xs:unsignedInt and has implicit lengthKind (hence, length 4 bytes) and representation is 'binary'. 
> This should work to subtract 4 bytes from the value of the prefix to get the value of the length of the content. 
> However, I get this backtrace:
> {code:java}
> java.util.NoSuchElementException: None.get    at scala.None$.get(Option.scala:529)
>     at scala.None$.get(Option.scala:527)
>     at org.apache.daffodil.grammar.ElementBaseGrammarMixin.prefixedLengthAdjustmentInUnits(ElementBaseGrammarMixin.scala:201)
>     at org.apache.daffodil.grammar.ElementBaseGrammarMixin.prefixedLengthAdjustmentInUnits$(ElementBaseGrammarMixin.scala:193)
>     at org.apache.daffodil.dsom.AbstractElementRef.prefixedLengthAdjustmentInUnits$lzycompute(ElementRef.scala:38)
>     at org.apache.daffodil.dsom.AbstractElementRef.prefixedLengthAdjustmentInUnits(ElementRef.scala:38)
>     at org.apache.daffodil.grammar.primitives.SpecifiedLengthPrefixed.pladj$lzycompute(SpecifiedLength.scala:156)
>     at org.apache.daffodil.grammar.primitives.SpecifiedLengthPrefixed.pladj(SpecifiedLength.scala:156) {code}
> It seems to be because Daffodil is assuming there will be a lengthEv for the length of the prefix, but if the prefixLengthType itself uses lengthKind 'implicit' there will not be a lengthEv (currently). 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)