Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BD6C4200CD1 for ; Wed, 12 Jul 2017 01:34:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BBA60167934; Tue, 11 Jul 2017 23:34:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0DF4816792C for ; Wed, 12 Jul 2017 01:34:11 +0200 (CEST) Received: (qmail 81085 invoked by uid 500); 11 Jul 2017 23:34:11 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 81074 invoked by uid 99); 11 Jul 2017 23:34:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2017 23:34:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 998F1195CCC for ; Tue, 11 Jul 2017 23:34:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.702 X-Spam-Level: X-Spam-Status: No, score=-98.702 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id WHuxqt8TtTEy for ; Tue, 11 Jul 2017 23:34:09 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E30C46281B for ; Tue, 11 Jul 2017 22:54:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D78A7E0D85 for ; Tue, 11 Jul 2017 22:54:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3E0A424704 for ; Tue, 11 Jul 2017 22:54:00 +0000 (UTC) Date: Tue, 11 Jul 2017 22:54:00 +0000 (UTC) From: "Konstantin Shvachko (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-14586) StringIndexOutOfBoundsException breaks org.apache.hadoop.util.Shell on 2.7.x with Java 9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 11 Jul 2017 23:34:12 -0000 [ https://issues.apache.org/jira/browse/HADOOP-14586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Konstantin Shvachko updated HADOOP-14586: ----------------------------------------- Summary: StringIndexOutOfBoundsException breaks org.apache.hadoop.util.Shell on 2.7.x with Java 9 (was: org.apache.hadoop.util.Shell in 2.7 breaks on Java 9 RC build; backport HADOOP-10775 to 2.7.x) > StringIndexOutOfBoundsException breaks org.apache.hadoop.util.Shell on 2.7.x with Java 9 > ---------------------------------------------------------------------------------------- > > Key: HADOOP-14586 > URL: https://issues.apache.org/jira/browse/HADOOP-14586 > Project: Hadoop Common > Issue Type: Bug > Components: common > Affects Versions: 2.7.2 > Environment: Java 9, build 175 (Java 9 release candidate as of June 25th, 2017) > Reporter: Uwe Schindler > Assignee: Akira Ajisaka > Priority: Minor > Labels: Java9 > Attachments: HADOOP-14586-branch-2.7-01.patch, HADOOP-14586-branch-2.7-02.patch, HADOOP-14586-branch-2.7-03.patch > > > You cannot use any pre-Hadoop 2.8 component anymore with the latest release candidate build of Java 9, because it fails with an StringIndexOutOfBoundsException in {{org.apache.hadoop.util.Shell#}}. This leads to a whole cascade of failing classes (next in chain is StringUtils). > The reason is that the release candidate build of Java 9 no longer has "-ea" in the version string and the system property "java.version" is now simply "9". This causes the following line to fail fatally: > {code:java} > private static boolean IS_JAVA7_OR_ABOVE = > System.getProperty("java.version").substring(0, 3).compareTo("1.7") >= 0; > {code} > Analysis: > - This code looks wrong, as comparing a version this way is incorrect. > - The {{substring(0, 3)}} is not needed, {{compareTo}} also works without it, although it is still an invalid way to compare a version. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org