commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r724189 - /commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java
Date Sun, 07 Dec 2008 20:19:02 GMT
Author: luc
Date: Sun Dec  7 12:19:01 2008
New Revision: 724189

URL: http://svn.apache.org/viewvc?rev=724189&view=rev
Log:
updated error generation

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java?rev=724189&r1=724188&r2=724189&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/linear/AbstractRealMatrix.java
Sun Dec  7 12:19:01 2008
@@ -301,17 +301,22 @@
 
         final int nRows = subMatrix.length;
         if (nRows == 0) {
-            throw new IllegalArgumentException("Matrix must have at least one row."); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at
least one row",
+                                                                      null); 
         }
 
         final int nCols = subMatrix[0].length;
         if (nCols == 0) {
-            throw new IllegalArgumentException("Matrix must have at least one column.");

+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at
least one column",
+                                                                      null); 
         }
 
         for (int r = 1; r < nRows; ++r) {
             if (subMatrix[r].length != nCols) {
-                throw new IllegalArgumentException("All input rows must have the same length.");
+                throw MathRuntimeException.createIllegalArgumentException("some rows have
length {0} while others have length {1}",
+                                                                          new Object[] {
+                                                                              nCols, subMatrix[r].length
+                                                                          }); 
             }
         }
 



Mime
View raw message