You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2022/02/14 18:41:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17492165#comment-17492165 ]
Mike Beckerle commented on DAFFODIL-2657:
-----------------------------------------
PR [https://github.com/apache/daffodil/pull/752]
Adds test (currently fails, so commented out) to Daffodil test suite that illustrate this bug.
> 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 "End"
> Affects Versions: 3.2.1
> Reporter: Mike Beckerle
> Priority: Major
>
> 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)