[
https://issues.apache.org/jira/browse/DAFFODIL-2891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dave Thompson closed DAFFODIL-2891.
-----------------------------------
Verified the specified commit (commit 5ca4319c83da3d5caf5d9e17ce6a05a021e621ab)
is included in the latest pull from the daffodil repository.
Verified, via review, changes identified in the commit comment were
implemented.
Verified the affected daffodil subproject sbt test suites executed
successfully, including the added test.
Rolled commit back to pre-fix commit and executed the new test and verified
that the error message identified in the initial writeup (Abort: Invariant
broken: minReps.==(0L)) occurred.
> Abort: Invariant broken: minReps.==(0L) when unparsing
> ------------------------------------------------------
>
> Key: DAFFODIL-2891
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2891
> Project: Daffodil
> Issue Type: Bug
> Components: Unparsing
> Reporter: Steve Lawrence
> Assignee: Steve Lawrence
> Priority: Major
> Fix For: 3.8.0
>
>
> If we have a schema with an array with occursCountKind="expression" and
> minOccurs greater than zero, and we unparse an infoset where there are zero
> occurrences, we get an abort assertion. This is not a valid infoset, but we
> should get an UnparseError instead of an abort.
> *Schema:*
> {code:xml}
> <simpleType name="oneNum" dfdl:lengthKind="explicit" dfdl:length="1">
> <restriction base="xs:int" />
> </simpleType>
> <element name="root">
> <complexType>
> <sequence>
> <element name="field1Occurs" type="ex:oneNum" />
> <element name="field1" type="ex:oneNum" minOccurs="1" maxOccurs="255"
> dfdl:occursCountKind="expression" dfdl:occursCount="{
> ../field1Occurs }" />
> <element name="field2" type="ex:oneNum" minOccurs="1" maxOccurs="255"
> dfdl:occursCountKind="parsed" />
> </sequence>
> </complexType>
> </element>
> {code}
> *Infoset:*
> {code:xml}
> <ex:root xmlns:ex="http://example.com">
> <field1Occurs>0</field1Occurs>
> <field2>1</field2>
> <field2>2</field2>
> <field2>3</field2>
> <field2>4</field2>
> </ex:root>
> {code}
> *Error:*
> {code}
> org.apache.daffodil.lib.exceptions.Abort: Invariant broken: minReps.==(0L)
> org.apache.daffodil.lib.exceptions.Assert$.abort(Assert.scala:159)
> org.apache.daffodil.unparsers.runtime1.OrderedUnseparatedSequenceUnparser.unparse(UnseparatedSequenceUnparsers.scala:159)
> org.apache.daffodil.runtime1.processors.unparsers.Unparser.unparse1(Unparser.scala:75)
> org.apache.daffodil.runtime1.processors.unparsers.Unparser.unparse1$(Unparser.scala:38)
> at org.apache.daffodil.lib.exceptions.Assert$.abort(Assert.scala:159)
> at
> org.apache.daffodil.unparsers.runtime1.OrderedUnseparatedSequenceUnparser.unparse(UnseparatedSequenceUnparsers.scala:159)
> at
> org.apache.daffodil.runtime1.processors.unparsers.Unparser.unparse1(Unparser.scala:75)
> at
> org.apache.daffodil.runtime1.processors.unparsers.Unparser.unparse1$(Unparser.scala:38)
> at
> org.apache.daffodil.runtime1.processors.unparsers.CombinatorUnparser.unparse1(Unparser.scala:124)
> at
> org.apache.daffodil.unparsers.runtime1.ElementUnparserBase.runContentUnparser(ElementUnparser.scala:181)
> at
> org.apache.daffodil.unparsers.runtime1.ElementUnparserBase.unparse(ElementUnparser.scala:202)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)