Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4965D18B6D for ; Wed, 2 Mar 2016 16:47:25 +0000 (UTC) Received: (qmail 43975 invoked by uid 500); 2 Mar 2016 16:47:19 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 43875 invoked by uid 500); 2 Mar 2016 16:47:19 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 43563 invoked by uid 99); 2 Mar 2016 16:47:19 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 16:47:19 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 566082C1F6F for ; Wed, 2 Mar 2016 16:47:18 +0000 (UTC) Date: Wed, 2 Mar 2016 16:47:18 +0000 (UTC) From: "Alessio Soldano (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6811) org.apache.cxf.common.util.ClassHelper.getJavaVersion() method will fail on JDK9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175932#comment-15175932 ] Alessio Soldano commented on CXF-6811: -------------------------------------- I would actually suggest removing that method, as it does not seem to be used anywhere in Apache CXF sources and from a user point of view it does not add a lot on top of a basic System.getProperty("java.version") . > 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 > {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.3.4#6332)