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 2020/10/14 12:16:33 UTC

[GitHub] [incubator-daffodil] jadams-tresys commented on a change in pull request #433: Alert user to use blobs instead of hexBinary

jadams-tresys commented on a change in pull request #433:
URL: https://github.com/apache/incubator-daffodil/pull/433#discussion_r504628161



##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/SpecifiedLengthParsers.scala
##########
@@ -90,7 +90,9 @@ sealed abstract class SpecifiedLengthParserBase(
     Assert.invariant(dis eq pState.dataInputStream)
     val bitsToSkip = finalEndPos0b - dis.bitPos0b
     Assert.invariant(bitsToSkip >= 0) // if this is < 0, then the parsing of children went past the limit, which it isn't supposed to.
-    if (bitsToSkip > 0) {
+    if (bitsToSkip > Int.MaxValue) {
+      PE(pState, "Data too large, consider using blobs instead: https://cwiki.apache.org/confluence/display/DAFFODIL/Proposal%3A+Binary+Large+Objects")
+    } else if (bitsToSkip > 0) {

Review comment:
       Hm, would a better fix be to modify the various get functions to use Longs, but then throw a ParseError inside the get functions if the value ends up being larger than Int.MaxValue?




----------------------------------------------------------------
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.

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