Richard Opalka created CXF-6811:
-----------------------------------
Summary: 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
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
public static double getJavaVersion() {
String version = System.getProperty("java.version");
return Double.parseDouble(version.substring(0, 3));
}
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.3.4#6332)