stevedlawrence commented on a change in pull request #59: Add new tunable 
(errorOnUnsupportedJavaVersion) to allow running with older versions of Java
URL: https://github.com/apache/incubator-daffodil/pull/59#discussion_r178911226
 
 

 ##########
 File path: 
daffodil-lib/src/main/scala/org/apache/daffodil/api/DaffodilTunables.scala
 ##########
 @@ -105,7 +105,19 @@ case class DaffodilTunables(
   // This may cause a degredation of performance in path expression evaluation,
   // so this should be avoided when in production. This flag is automatically
   // enabled when debugging is enabled.
-  val allowExternalPathExpressions: Boolean = false)
+  val allowExternalPathExpressions: Boolean = false,
+
+  // A bug exists in Java 7 that causes unexpected behavior when decode errors
+  // occur in the specific ways that Daffodil decodes data. For this reason,
+  // Daffodil throws an exception when it detects that Daffodil is not running
+  // under Java 8 or has this decoder bug. However, there are some cases where
+  // a user has no choice but to run on Java 7. Setting this tunable to false
+  // will cause Daffodil to log a warning rather than throw an exception so
+  // that a user can run Daffodil on unsupported Java versions, with the
+  // understanding that it is not fully tested and behavior may not be well
+  // defined. This boolean is experimental and should only be used by those
+  // that fully understand the risks.
+  val errorOnUnsupportedJavaVersion: Boolean = true)
 
 Review comment:
   The more I think about environment variables to control this, the less I 
like it. It just seems like incorrect use of environment variables. Another 
option, which I think is a bit more of a standard, is to just use a 
configuration file. We already support a configuration file for the CLI, so 
this can just share that same logic for extracting. So I propose the following 
instead for the creation of DaffodilTunables:
   
   1. Create a DaffodilTunables instance with the defaults specified in the 
source
   2. If a global configuration file exists (e.g. /etc/daffodil/config.xml), 
read tunables from that and override the values set above
   3. Local tunable options can then be provided to override those, for example 
via the -c option in the CLI, setTunables API, or TDMLRunner tunable mechanism.
   
   So setting this tunable is just like setting any other tunable via a 
configuration file. We don't need any logic to extract and convert environtment 
variables, and the default code in DaffodilTunables isn't made messy.
   
   I'm not sure if there is a standard way for java applications to find a 
configuration file in /etc, but I imagine something exists.

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