You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Dave Thompson (JIRA)" <ji...@apache.org> on 2018/10/08 13:39:00 UTC

[jira] [Closed] (DAFFODIL-1964) Unparsing ArrayCombinator assertion failure

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

Dave Thompson closed DAFFODIL-1964.
-----------------------------------

Pulled latest updates from incubator-daffodil repository which included specified commit, 73d071750b7b484e010cb357f226b93de2f4439a.

Verified daffodil builds and executes all sbt tests successfully, including the test cases specified in this JIRA ticket.

Verified changes specified in the commit comment included.

All nightly tests also executed successfully.

> Unparsing ArrayCombinator assertion failure
> -------------------------------------------
>
>                 Key: DAFFODIL-1964
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1964
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, Unparsing
>    Affects Versions: 2.1.0
>            Reporter: Steve Lawrence
>            Assignee: Dave Thompson
>            Priority: Major
>             Fix For: 2.2.0
>
>
> A user reported an error when unparsing in the array combinator.
> The schema looks something like this:
> {code}
> ...
> <xs:sequence>
>   <xs:element name="foo" ... />
>   <xs:element name="bar" minOccurs="1" maxOccurs="6" dfdl:occursCountKind="implicit">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:annotation>
>           <xs:appinfo source="http://www.ogf.org/dfdl/">
>             <dfdl:discriminator>{ expression }</dfdl:discriminator>
>           </xs:appinfo>
>         </xs:annotation>
>         <xs:sequence dfdl:hiddenGroupRef="hiddenGrouPRef" />
>         <xs:group ref="someGroupWithRequiredElement"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
> </xs:sequence>
> ...
> {code}
> With XML that looks like this:
> {code}
> <foo>...</foo>
> {code}
> So the bar element is an array that requires at least one instance, but the infoset has zero instances. Trying to unparse this resultsin the following:
> {code}
> org.apache.daffodil.exceptions.Abort: Invariant broken: event.isStart.&&(event.node.isInstanceOf[org.apache.daffodil.infoset.DIArray])
> org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
> org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
> org.apache.daffodil.processors.unparsers.ArrayCombinatorUnparser.unparse(ElementKindUnparsers.scala:254)
> org.apache.daffodil.processors.unparsers.Unparser$class.unparse1(Unparser.scala:72)
> ... 
> {code}
> The expected result is to return an UnaparseError about expecting a start array event but not getting one. I think the assertion just needs to be changed to an UnparseError, since there is clearly a case where the assertion doesn't hold.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)