mbeckerle commented on a change in pull request #131: Added max/minValidYear tunable URL: https://github.com/apache/incubator-daffodil/pull/131#discussion_r230788834
########## File path: daffodil-lib/src/main/scala/org/apache/daffodil/api/DaffodilTunables.scala ########## @@ -138,7 +138,15 @@ case class DaffodilTunables( val maximumSimpleElementSizeInCharacters: Int = 1024 * 1024, val initialRegexMatchLimitInCharacters: Int = 64, - val maximumRegexMatchLengthInCharacters: Int = 1024 * 1024) + val maximumRegexMatchLengthInCharacters: Int = 1024 * 1024, + + /* Due to differences in the DFDL spec and ICU4J SimpleDateFormat, we must have SimpleDateFormat + * parse in lenient mode, which allows the year value to overflow with very large years + * into possibly negative years. These tunables simply make sure that value we get back + * from SimpleDateFormat are reasonable + */ + val minValidYear: Int = 0, + val maxValidYear: Int = 9999) Review comment: Did you hear the joke about the year 10,000 bug? In 1999, mainframe programmer is cryogenically frozen because he thinks the world will end due to the Y2K bug. Alas, due to said bug, he is not unfrozen in 2001 as he hoped. Instead he is unfrozen in year 9999, and the first words he hears are.... "Do you know DFDL?". Now seriously, can I set this to years substantially farther into the future? What 's the max positive value of maxValidYear? Scientists like astronomers use crazy calculations that integrate forward many centuries, and could, perhaps create crazy data accordingly. I would just suggest adding a comment to indicate either that 9999 is the largest value here, and it can only be set lower, or that it can be set as large as X for some X. If X is some library-implementation-specific value, then comment to that effect, and just give example of some larger X that we know works as an example is fine too. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
