You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stevedlawrence (via GitHub)" <gi...@apache.org> on 2026/04/17 16:39:30 UTC
[PR] Convert NodeInfo.Nothing from a lazy val to an object [daffodil]
stevedlawrence opened a new pull request, #1655:
URL: https://github.com/apache/daffodil/pull/1655
The NodeInfo.Nothing instance has a `children` Delay member that never actually gets evaluated. This is fine and not unexpected since Nothing doesn't really have children and so nothing ever attempts to access or need the member.
However, in some cases it is possible for the Nothing val to be referenced in a serialized class (e.g. in a DPath expression object that stores argument types such as fn:round-half-to-even) when creating a saved parser. And because this Nothing has a Delay that is never evaluated, it leads to an "object not initialized" exception, preventing creating a saved parser.
To fix this issue, this changes NodeInfo.Nothing from a lazy val to an object. Whether we use a lazy val or an object here really does not make a difference with how we use it, but in Scala lazy vals are serialized while objects are not--Scala only serializes object names which are used to look up and return the singleton instance during deserialization. This allows us to avoid all possible serialization issues, and also changes Nothing to match the same pattern as all the other TypeNodes.
DAFFODIL-3079
--
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
Re: [PR] Convert NodeInfo.Nothing from a lazy val to an object [daffodil]
Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence merged PR #1655:
URL: https://github.com/apache/daffodil/pull/1655
--
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