Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 81265 invoked from network); 9 Dec 2009 08:33:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 08:33:40 -0000 Received: (qmail 6474 invoked by uid 500); 9 Dec 2009 08:33:40 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 6389 invoked by uid 500); 9 Dec 2009 08:33:40 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 6380 invoked by uid 99); 9 Dec 2009 08:33:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 08:33:40 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 08:33:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1E35A234C04C for ; Wed, 9 Dec 2009 00:33:18 -0800 (PST) Message-ID: <646588548.1260347598107.JavaMail.jira@brutus> Date: Wed, 9 Dec 2009 08:33:18 +0000 (UTC) From: "Sean Qiu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6395) [classlib][luni] Arrays.sort(double []) will result in StackOverflowError for specific arrays input In-Reply-To: <23353269.1259581820788.JavaMail.jira@brutus> 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/HARMONY-6395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787971#action_12787971 ] Sean Qiu commented on HARMONY-6395: ----------------------------------- Jim, what do you think about Tim's patch? It is all right for me. if you agree, I will apply Tim' s patch instead. > [classlib][luni] Arrays.sort(double []) will result in StackOverflowError for specific arrays input > --------------------------------------------------------------------------------------------------- > > Key: HARMONY-6395 > URL: https://issues.apache.org/jira/browse/HARMONY-6395 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M11 > Reporter: Jim Yu > Assignee: Sean Qiu > Attachments: harmony-6395-2.patch, HARMONY-6395.diff > > > There is a simple testcase as below. You can see StackOverflowError if run this testcase. This is a defect of Arrays.sort(double []), I have attached a fix for it. > import java.util.Arrays; > public class SortTest { > public static void main(String[] args) { > double[] array = { Double.NaN, 1.0, 2.0, Double.NaN, Double.NaN, 3.0, > 4.0 }; > displayArray(array); > Arrays.sort(array); > displayArray(array); > System.out.println(); > } > private static void displayArray(double[] array) { > for (double d : array) > System.out.print(d + " "); > System.out.println(); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.