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/08 12:34:00 UTC

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

    [ https://issues.apache.org/jira/browse/DAFFODIL-2338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102535#comment-17102535 ] 

Josh Adams edited comment on DAFFODIL-2338 at 5/8/20, 12:33 PM:
----------------------------------------------------------------

I'm thinking it probably makes sense for me to roll these changes into my fromXMLString changes on DAFFODIL-2124


was (Author: jadams_tresys):
I'm thinking it probably makes sense for me to roll these changes into my fromXMLString changes on DAFFODIL-2132

> 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
>            Assignee: Josh Adams
>            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)