You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2018/01/04 16:30:01 UTC
[jira] [Assigned] (CXF-6811)
org.apache.cxf.common.util.ClassHelper.getJavaVersion() method will fail on
JDK9
[ https://issues.apache.org/jira/browse/CXF-6811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh reassigned CXF-6811:
----------------------------------------
Assignee: Colm O hEigeartaigh
> 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
> 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
(v6.4.14#64029)