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

Colm O hEigeartaigh closed CXF-6811.
------------------------------------

> org.apache.cxf.common.util.ClassHelper.getJavaVersion() method will fail on 
> JDK9
> --------------------------------------------------------------------------------
>
>                 Key: CXF-6811
>                 URL: https://issues.apache.org/jira/browse/CXF-6811
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.1.5
>            Reporter: Richard Opalka
>            Assignee: Colm O hEigeartaigh
>            Priority: Major
>             Fix For: 3.1.15
>
>
> JDK9 will come with new versioning scheme, see:
> http://openjdk.java.net/jeps/223
> We identified the following snippet of code to be problematic for JDK9 
> adoption:
> org.apache.cxf.common.util.ClassHelper
> {code}
> public static double getJavaVersion() {
>     String version = System.getProperty("java.version");
>     return Double.parseDouble(version.substring(0, 3));
> }
> {code}
> ATM this code fails on:
> Exception in thread "main" java.lang.NumberFormatException: For input string: 
> "9-e"
>       at 
> jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
>       at 
> jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
>       at java.lang.Double.parseDouble(Double.java:539)
>       at 
> org.apache.cxf.common.util.ClassHelper.getJavaVersion(ClassHelper.java:90)
> with Early access JDK9.
> Once official JDK9 is released this code will fail on 
> StringIndexOutOfBoundsException.



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

Reply via email to