commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1144994 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
Date Mon, 11 Jul 2011 00:52:20 GMT
Author: psteitz
Date: Mon Jul 11 00:52:20 2011
New Revision: 1144994

URL: http://svn.apache.org/viewvc?rev=1144994&view=rev
Log:
Restored jdk 1.5 compat.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java?rev=1144994&r1=1144993&r2=1144994&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
Mon Jul 11 00:52:20 2011
@@ -65,10 +65,12 @@ public class RegressionResults implement
             final boolean containsConstant,
             final boolean copyData) {
         if (copyData) {
-            this.parameters = Arrays.copyOf(parameters, parameters.length);
+            this.parameters = new double[parameters.length];
+            System.arraycopy(parameters, 0, this.parameters, 0, parameters.length);
             this.varCovData = new double[varcov.length][];
             for (int i = 0; i < varcov.length; i++) {
-                this.varCovData[i] = Arrays.copyOf(varcov[i], varcov[i].length);
+                this.varCovData[i] = new double[varcov[i].length];
+                System.arraycopy(varcov[i], 0, this.varCovData[i], 0, varcov[i].length);
             }
         } else {
             this.parameters = parameters;
@@ -135,7 +137,9 @@ public class RegressionResults implement
         if (this.parameters == null) {
             return null;
         }
-        return Arrays.copyOf(parameters, parameters.length);
+        double[] out = new double[parameters.length];
+        System.arraycopy(parameters, 0, out, 0, parameters.length);
+        return out;
     }
 
     /**



Mime
View raw message