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

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

Reply via email to