Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 357F0D11A for ; Tue, 13 Nov 2012 14:14:12 +0000 (UTC) Received: (qmail 99176 invoked by uid 500); 13 Nov 2012 14:14:12 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 98835 invoked by uid 500); 13 Nov 2012 14:14:11 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 98810 invoked by uid 99); 13 Nov 2012 14:14:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 14:14:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 14:14:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A27302388906 for ; Tue, 13 Nov 2012 14:13:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1408735 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/util/ResizableDoubleArray.java test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java Date: Tue, 13 Nov 2012 14:13:47 -0000 To: commits@commons.apache.org From: erans@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121113141347.A27302388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: erans Date: Tue Nov 13 14:13:46 2012 New Revision: 1408735 URL: http://svn.apache.org/viewvc?rev=1408735&view=rev Log: MATH-894 Removed the reallocation in method "clear()". Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java?rev=1408735&r1=1408734&r2=1408735&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java Tue Nov 13 14:13:46 2012 @@ -415,7 +415,6 @@ public class ResizableDoubleArray implem public synchronized void clear() { numElements = 0; startIndex = 0; - internalArray = new double[initialCapacity]; } /** Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java?rev=1408735&r1=1408734&r2=1408735&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ResizableDoubleArrayTest.java Tue Nov 13 14:13:46 2012 @@ -130,7 +130,7 @@ public class ResizableDoubleArrayTest ex @Test - public void testSetElementArbitraryExpansion() { + public void testSetElementArbitraryExpansion1() { // MULTIPLICATIVE_MODE da.addElement(2.0); @@ -151,9 +151,11 @@ public class ResizableDoubleArrayTest ex Double.MIN_VALUE ); Assert.assertEquals( "The 0th index should be 2.0, it isn't", 2.0, da.getElement(0), Double.MIN_VALUE); + } + @Test + public void testSetElementArbitraryExpansion2() { // Make sure numElements and expansion work correctly for expansion boundary cases - da.clear(); da.addElement(2.0); da.addElement(4.0); da.addElement(6.0);