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 2023/04/18 15:46:00 UTC

[jira] [Closed] (DAFFODIL-2808) Incorrect Validation Error on Optional Element with Children

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

Dave Thompson closed DAFFODIL-2808.
-----------------------------------

Verified the specified commit (commit c8e7059ed70ba4e5f97c610b946dc9d33b4a2027) 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.

Verified the nightly test schemas compile and save successfully with no unexpected failures/errors.

Verified the nightly test suite (full run) executes successfully with -V limited (limited validation) with unexpected validation errors with the following data format tests. Verified that the fix corrected the initial specified validation errors.

 - ato parse tests
 - uscg-ucop parse tests

I rolled the commit back to the previous commit and got the same validation errors.  

Closing this ticket because the commit is not the cause of the unexpected validation errors. The validation errors were determined, by dev, to be valid and issues with the data schemas vs source files. These will be documented separately.

> Incorrect Validation Error on Optional Element with Children
> ------------------------------------------------------------
>
>                 Key: DAFFODIL-2808
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2808
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.5.0
>            Reporter: Olabusayo Kilo
>            Assignee: Steve Lawrence
>            Priority: Major
>             Fix For: 3.5.0
>
>         Attachments: optionElementTest.scala, optionalElement.tdml
>
>
> When you have an optional element with children element, daffodil calculates the number of occurrences it has by looking at the number of children it has, rather than calculating the number of times it appears. This results in an validation error saying the element occurred NUM_OF_CHILDREN_TIME when it was expected.
> Attached is a TDML test that shows this incorrect validation error
> I narrowed down the  error to src/main/scala/org/apache/daffodil/runtime1/processors/parsers/SequenceChildBases.scala line 543 in endArray
> {code:scala}
>         val occurrence = {
>           val maybeLastChild = state.infoset.maybeLastChild
>           if (maybeLastChild.isEmpty || maybeLastChild.get.erd != erd)
>             0
>           else
>             maybeLastChild.get.numChildren
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)