commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1206672 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java
Date Sun, 27 Nov 2011 07:07:57 GMT
Author: psteitz
Date: Sun Nov 27 07:07:56 2011
New Revision: 1206672

URL: http://svn.apache.org/viewvc?rev=1206672&view=rev
Log:
Restored 1.5 compatatibility. Thanks, Gump.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java?rev=1206672&r1=1206671&r2=1206672&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/UnivariateStatisticAbstractTest.java
Sun Nov 27 07:07:56 2011
@@ -17,7 +17,6 @@ s * Unless required by applicable law or
 package org.apache.commons.math.stat.descriptive;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 
@@ -104,11 +103,14 @@ public abstract class UnivariateStatisti
     @Test
     public void testEvaluateArraySegment() {
         final UnivariateStatistic stat = getUnivariateStatistic();
-        final double[] arrayZero = Arrays.copyOfRange(testArray, 0, 5);
+        final double[] arrayZero = new double[5];
+        System.arraycopy(testArray, 0, arrayZero, 0, 5);
         Assert.assertEquals(stat.evaluate(arrayZero), stat.evaluate(testArray, 0, 5), 0);
-        final double[] arrayOne = Arrays.copyOfRange(testArray, 5, 10);
+        final double[] arrayOne = new double[5];
+        System.arraycopy(testArray, 5, arrayOne, 0, 5);
         Assert.assertEquals(stat.evaluate(arrayOne), stat.evaluate(testArray, 5, 5), 0);
-        final double[] arrayEnd = Arrays.copyOfRange(testArray, testArray.length - 5, testArray.length);
+        final double[] arrayEnd = new double[5];
+        System.arraycopy(testArray, testArray.length - 5, arrayEnd, 0, 5);
         Assert.assertEquals(stat.evaluate(arrayEnd), stat.evaluate(testArray, testArray.length
- 5, 5), 0);
     }
 



Mime
View raw message