You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/04/03 14:55:33 UTC

[GitHub] stevedlawrence commented on a change in pull request #59: Add new tunable (errorOnUnsupportedJavaVersion) to allow running with older versions of Java

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_r178853426
 
 

 ##########
 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:
   No, there isn't really a way to do that right now.
   
   We could perhaps modify the TDML runner to read specific environment variables and set tunables based on that. Or similarly, we could set the default value in the DaffodilTunables class based on environment variables and then it would affect everything, (e.g. CLI, API, TDMLRunner) rather than just the TDML runner. For example:
   ```scala
   class DaffodilTunables(
    ...
    val errorOnUnsupportedJavaVersion: Boolean = {
      val bool = scala.util.Properties.envOrElse("DAFFODIL_TUNABLE_ERROR_ON_UNSUPPORTED_JAVA_VERSION", "true")
      java.lagn.Boolean.valueOf(bool)
    }
    ...
   )
   ```
   That isn't too hairy of a change and makes it pretty easy to modify tunable values using environment variables.
   
   Alternatively, considering that we only officially support Java 8+, perhaps we can get away with just manually changing the default value of the tunable to false when we want to do a one off Java 7 test?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services