You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/12/08 14:35:43 UTC

[GitHub] [daffodil] stevedlawrence opened a new pull request, #889: Store the last added child in the PState for use in separator logic

stevedlawrence opened a new pull request, #889:
URL: https://github.com/apache/daffodil/pull/889

   In some cases, separator logic needs knowledge about the most recently added child of an element. This is currently handled by examining the infoset and finding its last child element using the maybeMostRecentlyAddedChild function.
   
   The problem with this approach is that the InfosetWalker is allowed to "release" elements from the infoset that it thinks are no longer needed. There isn't a good way to tell the infoset that these last children are potentially still needed for separator logic, and so it could actually release them prior to the separator logic trying to access them, which leads to a null pointer exception.
   
   To fix this, this modifies the PState to add a slot for the last modified child of the current infoset element, and modifies the ElementParser's to set this state appropriately. This way, the InfosetWalker is free to remove elements as it normally does, but the last child is still available when needed.
   
   This also removes the maybeMostRecentlyAddedChild functions since this kind of access to the infoset can lead to null pointers.
   
   Also modifies the SAXInfosetOutputter to check isNilled correctly, which supports checking if complex elements are nilled without being final yet. For similar reasons, modifies the InfosetWalker so that it does not walk into Complex elements if there is a chance that it could be nilled and we might not be sure.
   
   DAFFODIL-2755


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence merged pull request #889: Store the last added child in the PState for use in separator logic

Posted by GitBox <gi...@apache.org>.
stevedlawrence merged PR #889:
URL: https://github.com/apache/daffodil/pull/889


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org