[
https://issues.apache.org/jira/browse/DAFFODIL-2672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17519604#comment-17519604
]
Olabusayo Kilo commented on DAFFODIL-2672:
------------------------------------------
I ran into this in VMF too. The xsd below results in the stacktrace listed
under. The stacktrace is avoided by defining the length on aType_3. Otherwise
the length is -1, causing the assert to fail
{code:java}
<xs:simpleType name="aType_v1"
dfdl:lengthKind="explicit"
dfdl:length="4"
dfdl:lengthUnits="characters">
<xs:restriction base="aType">
<xs:pattern value="[A-Z][0-9][A-Z][ ]"/>
<xs:minLength value="4"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="aType_v2"
dfdl:lengthKind="explicit"
dfdl:length="4"
dfdl:lengthUnits="characters">
<xs:restriction base="aType">
<xs:pattern value="[A-Z][0-9]{2}[A-Z]"/>
<xs:minLength value="4"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="aType_v3">
<xs:union memberTypes="aType_v1 aType_v2"/>
</xs:simpleType>
<xs:group name="aType_v3_usage">
<xs:sequence>
<xs:element name="value" type="aType_v3"/>
</xs:sequence>
</xs:group>{code}
{noformat}
org.apache.daffodil.exceptions.Abort: Usage error: v.>=(0)
org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:137)
org.apache.daffodil.util.MaybeULong$.apply(MaybeULong.scala:54)
org.apache.daffodil.util.MaybeJULong$.apply(MaybeULong.scala:84)
org.apache.daffodil.processors.LengthInBitsEvBase.compute(EvElement.scala:144)
at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:137)
at org.apache.daffodil.util.MaybeULong$.apply(MaybeULong.scala:54)
at org.apache.daffodil.util.MaybeJULong$.apply(MaybeULong.scala:84)
at
org.apache.daffodil.processors.LengthInBitsEvBase.compute(EvElement.scala:144)
at
org.apache.daffodil.processors.LengthInBitsEvBase.compute(EvElement.scala:118)
at
org.apache.daffodil.processors.Evaluatable.evaluate(Evaluatable.scala:281)
at
org.apache.daffodil.processors.Evaluatable.compileTimeEvaluate(Evaluatable.scala:212)
at org.apache.daffodil.processors.Evaluatable.compile(Evaluatable.scala:317)
at org.apache.daffodil.processors.Evaluatable.compile(Evaluatable.scala:326)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.elementLengthInBitsEv(RuntimePropertyMixins.scala:352)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.elementLengthInBitsEv$(RuntimePropertyMixins.scala:336)
at
org.apache.daffodil.dsom.LocalElementDeclBase.elementLengthInBitsEv$lzycompute(LocalElementDecl.scala:25)
at
org.apache.daffodil.dsom.LocalElementDeclBase.elementLengthInBitsEv(LocalElementDecl.scala:25)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.unparseTargetLengthInBitsEv(RuntimePropertyMixins.scala:468)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.unparseTargetLengthInBitsEv$(RuntimePropertyMixins.scala:467)
at
org.apache.daffodil.dsom.LocalElementDeclBase.unparseTargetLengthInBitsEv$lzycompute(LocalElementDecl.scala:25)
at
org.apache.daffodil.dsom.LocalElementDeclBase.unparseTargetLengthInBitsEv(LocalElementDecl.scala:25)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.maybeUnparseTargetLengthInBitsEv(RuntimePropertyMixins.scala:441)
at
org.apache.daffodil.dsom.ElementRuntimeValuedPropertiesMixin.maybeUnparseTargetLengthInBitsEv$(RuntimePropertyMixins.scala:437)
at
org.apache.daffodil.dsom.LocalElementDeclBase.maybeUnparseTargetLengthInBitsEv$lzycompute(LocalElementDecl.scala:25)
at
org.apache.daffodil.dsom.LocalElementDeclBase.maybeUnparseTargetLengthInBitsEv(LocalElementDecl.scala:25)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:126)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser(GramRuntime1Mixin.scala:57)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser$(GramRuntime1Mixin.scala:54)
at
org.apache.daffodil.grammar.Gram.maybeUnparser$lzycompute(GrammarTerm.scala:51)
at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:51)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser$lzycompute(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:326)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:321)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:134)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.$anonfun$unparser$2(ChoiceCombinator.scala:262)
at
scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:193)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser$lzycompute(ChoiceCombinator.scala:261)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser(ChoiceCombinator.scala:215)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser(GramRuntime1Mixin.scala:57)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser$(GramRuntime1Mixin.scala:54)
at
org.apache.daffodil.grammar.Gram.maybeUnparser$lzycompute(GrammarTerm.scala:51)
at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:51)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser$lzycompute(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:326)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:321)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:134)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser(GramRuntime1Mixin.scala:57)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser$(GramRuntime1Mixin.scala:54)
at
org.apache.daffodil.grammar.Gram.maybeUnparser$lzycompute(GrammarTerm.scala:51)
at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:51)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser$lzycompute(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:326)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:321)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:134)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.$anonfun$unparser$2(ChoiceCombinator.scala:262)
at
scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:193)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser$lzycompute(ChoiceCombinator.scala:261)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser(ChoiceCombinator.scala:215)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser(GramRuntime1Mixin.scala:57)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser$(GramRuntime1Mixin.scala:54)
at
org.apache.daffodil.grammar.Gram.maybeUnparser$lzycompute(GrammarTerm.scala:51)
at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:51)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser$lzycompute(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:326)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:321)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:134)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.$anonfun$unparser$2(ChoiceCombinator.scala:262)
at
scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:400)
at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:728)
at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:728)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser$lzycompute(ChoiceCombinator.scala:261)
at
org.apache.daffodil.grammar.primitives.ChoiceCombinator.unparser(ChoiceCombinator.scala:215)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthCombinatorBase.eUnparser$lzycompute(SpecifiedLength.scala:45)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthCombinatorBase.eUnparser(SpecifiedLength.scala:44)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthExplicitImplicitUnparserMixin.unparser(SpecifiedLength.scala:103)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthExplicitImplicitUnparserMixin.unparser$(SpecifiedLength.scala:102)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthExplicit.unparser$lzycompute(SpecifiedLength.scala:114)
at
org.apache.daffodil.grammar.primitives.SpecifiedLengthExplicit.unparser(SpecifiedLength.scala:114)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.eUnparser$lzycompute(ElementCombinator.scala:101)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.eUnparser(ElementCombinator.scala:99)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:129)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser$lzycompute(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.childUnparser(SequenceChild.scala:72)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser$lzycompute(SequenceChild.scala:84)
at
org.apache.daffodil.grammar.primitives.SequenceChild.optSequenceChildUnparser(SequenceChild.scala:83)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.$anonfun$unparser$2(SequenceCombinator.scala:100)
at
scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser$lzycompute(SequenceCombinator.scala:100)
at
org.apache.daffodil.grammar.primitives.OrderedSequence.unparser(SequenceCombinator.scala:84)
at
org.apache.daffodil.grammar.SeqComp.$anonfun$unparserChildren$2(Grammar.scala:99)
at scala.collection.immutable.List.map(List.scala:297)
at
org.apache.daffodil.grammar.SeqComp.unparserChildren$lzycompute(Grammar.scala:98)
at org.apache.daffodil.grammar.SeqComp.unparserChildren(Grammar.scala:92)
at
org.apache.daffodil.grammar.SeqComp.unparser$lzycompute(Grammar.scala:105)
at org.apache.daffodil.grammar.SeqComp.unparser(Grammar.scala:104)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser(GramRuntime1Mixin.scala:57)
at
org.apache.daffodil.runtime1.GramRuntime1Mixin.maybeUnparser$(GramRuntime1Mixin.scala:54)
at
org.apache.daffodil.grammar.Gram.maybeUnparser$lzycompute(GrammarTerm.scala:51)
at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:51)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser$lzycompute(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eUnparser(ElementCombinator.scala:389)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:326)
at
org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:321)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:134)
at
org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:109)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:97)
at org.apache.daffodil.grammar.Prod.unparser(Production.scala:89)
at
org.apache.daffodil.runtime1.SchemaSetRuntime1Mixin.$anonfun$unparser$1(SchemaSetRuntime1Mixin.scala:83)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:679)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:677)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:674)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:724)
at org.apache.daffodil.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:724)
at
org.apache.daffodil.runtime1.SchemaSetRuntime1Mixin.unparser(SchemaSetRuntime1Mixin.scala:82)
at
org.apache.daffodil.runtime1.SchemaSetRuntime1Mixin.unparser$(SchemaSetRuntime1Mixin.scala:82)
at
org.apache.daffodil.dsom.SchemaSet.unparser$lzycompute(SchemaSet.scala:94)
at org.apache.daffodil.dsom.SchemaSet.unparser(SchemaSet.scala:94)
at
org.apache.daffodil.runtime1.SchemaSetRuntime1Mixin.$anonfun$$init$$2(SchemaSetRuntime1Mixin.scala:38)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:679)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:677)
at
org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:674)
at
org.apache.daffodil.oolag.OOLAG$OOLAGHost.$anonfun$checkErrors$2(OOLAG.scala:427)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.apache.daffodil.oolag.OOLAG$.keepGoing(OOLAG.scala:65)
at org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors(OOLAG.scala:427)
at org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors$(OOLAG.scala:413)
at
org.apache.daffodil.dsom.SchemaComponentImpl.checkErrors(SchemaComponent.scala:34)
at org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError(OOLAG.scala:484)
at org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError$(OOLAG.scala:483)
at org.apache.daffodil.dsom.SchemaSet.isError(SchemaSet.scala:543)
at org.apache.daffodil.compiler.ProcessorFactory.isError(Compiler.scala:135)
at
org.apache.daffodil.compiler.Compiler.org$apache$daffodil$compiler$Compiler$$compileSourceInternal(Compiler.scala:412)
at
org.apache.daffodil.compiler.Compiler$.org$apache$daffodil$compiler$Compiler$$compileSourceSynchronizer(Compiler.scala:454)
at org.apache.daffodil.compiler.Compiler.compileSource(Compiler.scala:397)
at org.apache.daffodil.compiler.Compiler.compileFile(Compiler.scala:381)
at org.apache.daffodil.sapi.Compiler.compileFile(Daffodil.scala:127)
at
com.tresys.TestSchemaCompilation.testCompilation(TestSchemaCompilation.scala:62)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at
com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at
com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54){noformat}
> type unions don't get proper length
> -----------------------------------
>
> Key: DAFFODIL-2672
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2672
> Project: Daffodil
> Issue Type: Bug
> Components: Middle "End"
> Affects Versions: 3.2.1
> Reporter: Mike Beckerle
> Priority: Minor
> Fix For: 3.4.0
>
>
> Consider this:
>
>
> {code:java}
> <dfdl:format ... lengthKind="implicit".../>
> <element name="seconds" type="tns:second"
> dfdl:lengthKind="explicit" dfdl:length="6"
> dfdl:lengthUnits="bits" dfdl:alignment="1"
> dfdl:alignmentUnits="bits"/>
> <simpleType name="second">
> <union>
> <simpleType>
> <restriction base="tns:checkedInt">
> <maxInclusive value="59"/>
> </restriction>
> </simpleType>
> <simpleType>
> <restriction base="tns:checkedInt">
> <enumeration value="63"/>
> </restriction>
> </simpleType>
> </union>
> </simpleType> {code}
> The above, the parser ends up going for a 32-bit integer, when the intention
> is for it to parse a 6 bit integer.
>
> This, however, works:
>
> {code:java}
> <element name="seconds" type="tns:second"
> dfdl:lengthUnits="bits" dfdl:alignment="1"
> dfdl:alignmentUnits="bits"/>
> <simpleType name="second" dfdl:lengthKind="explicit" dfdl:length="6">
> <union>
> <simpleType>
> <restriction base="tns:checkedInt">
> <maxInclusive value="59"/>
> </restriction>
> </simpleType>
> <simpleType>
> <restriction base="tns:checkedInt">
> <enumeration value="63"/>
> </restriction>
> </simpleType>
> </union>
> </simpleType> {code}
> So it seems that the combining of properties when the type is a union does
> not propagate the element's properties and combine them with the properties
> on each of the union types. Rather, the simpleType ends up ignoring the
> element's properties which specify explicit length of 6 bits, and instead
> takes the default format length of 32 (because this is a xs:unsignedInt
> ultimately).
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)