git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Commented] (DAFFODIL-1681) Need validation of infoset data


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

Steve Lawrence commented on DAFFODIL-1681:
------------------------------------------

A user recently found this issue with xs:unsignedInt. The infoset value was much larger than an xs:unsignedInt could hold, and when we tried to convert it to a long (since a long should be large enough to hold an xs:unsignedInt) they got a NumberFormatException. An exception is probably correct, but it should probably be a SDE or some other standard daffodil exception. 

> Need validation of infoset data
> -------------------------------
>
>                 Key: DAFFODIL-1681
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1681
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, General
>    Affects Versions: 2.0.0
>            Reporter: Steve Lawrence
>            Priority: Major
>             Fix For: deferred
>
>
> Currently, if you have a xs:hexBinary element that doesn't contain xs:hexBinary in the infoset, we get an InvalidArgumentException:
> {code}
> java.lang.IllegalArgumentException: Hex character must be 0-9, a-z, or A-Z, but was 'X'
> at edu.illinois.ncsa.daffodil.util.Misc$.hexCharToValue$1(Misc.scala:278)
> at edu.illinois.ncsa.daffodil.util.Misc$.hex2Bytes(Misc.scala:292)
> at edu.illinois.ncsa.daffodil.dpath.NodeInfo$PrimType$HexBinary$.fromXMLString(NodeInfo.scala:526)
> at edu.illinois.ncsa.daffodil.processors.unparsers.InfosetCursorFromXMLReader.createElement(InfosetCursorFromXMLReader.scala:373)
> at edu.illinois.ncsa.daffodil.processors.unparsers.InfosetCursorFromXMLReader.handleStartElement(InfosetCursorFromXMLReader.scala:279)
> at edu.illinois.ncsa.daffodil.processors.unparsers.InfosetCursorFromXMLReader.reallyFill(InfosetCursorFromXMLReader.scala:232)
> at edu.illinois.ncsa.daffodil.processors.unparsers.InfosetCursorFromXMLReader.fill(InfosetCursorFromXMLReader.scala:222)
> at edu.illinois.ncsa.daffodil.util.CursorImplMixin$class.doAdvance(Cursor.scala:189)
> at edu.illinois.ncsa.daffodil.util.CursorImplMixin$class.inspect(Cursor.scala:178)
> ..
> {code}
> We need to fix this, and ensure that all other data formats have proper error handling to report which element in the infoset was invalid.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)