[ 
https://issues.apache.org/jira/browse/DAFFODIL-1954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Lawrence reassigned DAFFODIL-1954:
----------------------------------------

    Assignee: Steve Lawrence

> Java version greater than 1.8 cause failure
> -------------------------------------------
>
>                 Key: DAFFODIL-1954
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1954
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>            Reporter: Steve Lawrence
>            Assignee: Steve Lawrence
>            Priority: Major
>              Labels: beginner
>             Fix For: 2.3.0
>
>
> If you try to use Daffodil with Java 10, you get a failure with the exception:
> {code}
> java.lang.NumberFormatException: Not a version: 10
>       at scala.util.PropertiesTrait$class.parts$1(Properties.scala:184)
>       at scala.util.PropertiesTrait$class.isJavaAtLeast(Properties.scala:188)
>       at scala.util.Properties$.isJavaAtLeast(Properties.scala:17)
>       at 
> org.apache.daffodil.util.CheckJavaVersion$.checkJavaVersion(CheckJavaVersion.scala:29)
>       at 
> org.apache.daffodil.compiler.ProcessorFactory$$anonfun$onPath$1.apply(Compiler.scala:166)
>       at 
> org.apache.daffodil.compiler.ProcessorFactory$$anonfun$onPath$1.apply(Compiler.scala:149)
>       at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
>       at 
> org.apache.daffodil.ExecutionMode$$anonfun$usingCompilerMode$1.apply(ExecutionMode.scala:64)
>       at 
> org.apache.daffodil.ExecutionMode$$anonfun$usingCompilerMode$1.apply(ExecutionMode.scala:64)
>       at 
> org.apache.daffodil.compiler.ProcessorFactory.onPath(Compiler.scala:149)
>       at org.apache.daffodil.Main$$anonfun$71.apply(Main.scala:714)
>       at org.apache.daffodil.Main$$anonfun$71.apply(Main.scala:711)
>       at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:76)
>       at org.apache.daffodil.util.Timer$.getResult(Timer.scala:35)
>       at org.apache.daffodil.Main$.createProcessorFromSchema(Main.scala:711)
>       at org.apache.daffodil.Main$.run(Main.scala:824)
>       at org.apache.daffodil.Main$.main(Main.scala:1297)
>       at org.apache.daffodil.Main.main(Main.scala)
> {code}
> It looks like Java changed their version schema to not use a dot (e.g. 10 vs 
> 1.10) and Scala 2.11's checker could handle that, so a NumberFormatException 
> is thrown.
> It looks like scala 2.12 has better checking for this (see DAFFODIL-1652), 
> but we should also catch a NumberFormatException here and treat that as if it 
> is not a valid Java version.
> This was reported on Java 10, but I suspect the same issues happens for Java 
> 9. Also, we should run our tests on Java 9/10 to ensure tests still pass with 
> a newer Java.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to