Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 50153 invoked from network); 20 Jul 2009 21:14:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jul 2009 21:14:07 -0000 Received: (qmail 63902 invoked by uid 500); 20 Jul 2009 21:15:11 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 63794 invoked by uid 500); 20 Jul 2009 21:15:11 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 63784 invoked by uid 99); 20 Jul 2009 21:15:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2009 21:15:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2009 21:15:01 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MT0C0-0002Gj-W9 for user@commons.apache.org; Mon, 20 Jul 2009 14:14:41 -0700 Message-ID: <24577692.post@talk.nabble.com> Date: Mon, 20 Jul 2009 14:14:40 -0700 (PDT) From: turicum To: user@commons.apache.org Subject: DescriptiveStatistics: addValue throws exception after clear MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: turicum@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi everybody! The following code throws an exception if x > 160 package test; import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; public class Test { public static void main(String[] strings) { int x = 161; // 160 works DescriptiveStatistics descriptiveStatistics = new DescriptiveStatistics(100); for (int i = 0; i < x; i++) descriptiveStatistics.addValue(1.2); descriptiveStatistics.clear(); descriptiveStatistics.addValue(1.2); } } Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 32 at org.apache.commons.math.util.ResizableDoubleArray.addElement(ResizableDoubleArray.java:255) at org.apache.commons.math.stat.descriptive.DescriptiveStatistics.addValue(DescriptiveStatistics.java:168) at test.Test.main(Test.java:11) Am I missing anything? Thanks! Alex -- View this message in context: http://www.nabble.com/DescriptiveStatistics%3A-addValue-throws-exception-after-clear-tp24577692p24577692.html Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org