You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Josh Adams (Jira)" <ji...@apache.org> on 2020/05/14 16:09:00 UTC

[jira] [Resolved] (DAFFODIL-2338) Use consistent validation of primitives

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

Josh Adams resolved DAFFODIL-2338.
----------------------------------
      Assignee:     (was: Josh Adams)
    Resolution: Fixed

This has been fixed in commit 6362e3ef9393c93b1e8c2de96d92bea548138760

The commit provides a more uniform validation and exception handling for the infoset.

> Use consistent validation of primitives
> ---------------------------------------
>
>                 Key: DAFFODIL-2338
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2338
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>            Reporter: Steve Lawrence
>            Priority: Major
>             Fix For: 3.0.0
>
>
> We use the isValidRange function in NodeInfo primititives to determine what values are not in the correct range of the type, and error accodingly. This logic is spread out in mutiple places that need to do range checking. And in some places (such as NodeInfo fromXMLString) we don't even do range checking.
> Instead of having this logic spread out, we should consolidate ranging checking logic in a single place, presumably in NodeInfo fromXMLString and fromNumber. These functions should only ever return a valid primitive in a valid range, or they should throw an exception if they aren't valid and why. We then modify all uses of these function to catch this exception and handle appropriately.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)