commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r981243 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/linear/ test/java/org/apache/commons/math/linear/
Date Sun, 01 Aug 2010 15:16:59 GMT
Author: luc
Date: Sun Aug  1 15:16:54 2010
New Revision: 981243

URL: http://svn.apache.org/viewvc?rev=981243&view=rev
Log:
deprecated an old style exception that was forgotten

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixIndexException.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixUtils.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixIndexExceptionTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java
Sun Aug  1 15:16:54 2010
@@ -1020,7 +1020,7 @@ public abstract class AbstractFieldMatri
      */
     protected void checkRowIndex(final int row) {
         if (row < 0 || row >= getRowDimension()) {
-            throw new MatrixIndexException("row index {0} out of allowed range [{1}, {2}]",
+            throw new MatrixIndexException(LocalizedFormats.ROW_INDEX_OUT_OF_RANGE,
                                            row, 0, getRowDimension() - 1);
         }
     }
@@ -1033,7 +1033,7 @@ public abstract class AbstractFieldMatri
     protected void checkColumnIndex(final int column)
         throws MatrixIndexException {
         if (column < 0 || column >= getColumnDimension()) {
-            throw new MatrixIndexException("column index {0} out of allowed range [{1}, {2}]",
+            throw new MatrixIndexException(LocalizedFormats.COLUMN_INDEX_OUT_OF_RANGE,
                                            column, 0, getColumnDimension() - 1);
         }
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
Sun Aug  1 15:16:54 2010
@@ -69,9 +69,8 @@ public abstract class AbstractRealVector
     protected void checkIndex(final int index)
         throws MatrixIndexException {
         if (index < 0 || index >= getDimension()) {
-            throw new MatrixIndexException(
-                  "index {0} out of allowed range [{1}, {2}]",
-                  index, 0, getDimension() - 1);
+            throw new MatrixIndexException(LocalizedFormats.INDEX_OUT_OF_RANGE,
+                                           index, 0, getDimension() - 1);
         }
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java
Sun Aug  1 15:16:54 2010
@@ -794,9 +794,8 @@ public class ArrayFieldVector<T extends 
     private void checkIndex(final int index)
         throws MatrixIndexException {
         if (index < 0 || index >= getDimension()) {
-            throw new MatrixIndexException(
-                    "index {0} out of allowed range [{1}, {2}]",
-                    index, 0, getDimension() - 1);
+            throw new MatrixIndexException(LocalizedFormats.INDEX_OUT_OF_RANGE,
+                                           index, 0, getDimension() - 1);
         }
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixIndexException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixIndexException.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixIndexException.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixIndexException.java
Sun Aug  1 15:16:54 2010
@@ -35,7 +35,9 @@ public class MatrixIndexException extend
      * Constructs a new instance with specified formatted detail message.
      * @param pattern format specifier
      * @param arguments format arguments
+     * @deprecated as of 2.2 replaced by {@link #MatrixIndexException(Localizable, Object...)}
      */
+    @Deprecated
     public MatrixIndexException(final String pattern, final Object ... arguments) {
       this(new DummyLocalizable(pattern), arguments);
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixUtils.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixUtils.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/MatrixUtils.java
Sun Aug  1 15:16:54 2010
@@ -529,7 +529,7 @@ public class MatrixUtils {
      */
     public static void checkRowIndex(final AnyMatrix m, final int row) {
         if (row < 0 || row >= m.getRowDimension()) {
-            throw new MatrixIndexException("row index {0} out of allowed range [{1}, {2}]",
+            throw new MatrixIndexException(LocalizedFormats.ROW_INDEX_OUT_OF_RANGE,
                                            row, 0, m.getRowDimension() - 1);
         }
     }
@@ -543,7 +543,7 @@ public class MatrixUtils {
     public static void checkColumnIndex(final AnyMatrix m, final int column)
         throws MatrixIndexException {
         if (column < 0 || column >= m.getColumnDimension()) {
-            throw new MatrixIndexException("column index {0} out of allowed range [{1}, {2}]",
+            throw new MatrixIndexException(LocalizedFormats.COLUMN_INDEX_OUT_OF_RANGE,
                                            column, 0, m.getColumnDimension() - 1);
         }
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java
Sun Aug  1 15:16:54 2010
@@ -549,9 +549,8 @@ public class SparseFieldVector<T extends
      */
     private void checkIndex(final int index) throws MatrixIndexException {
         if (index < 0 || index >= getDimension()) {
-            throw new MatrixIndexException(
-                    "index {0} out of allowed range [{1}, {2}]",
-                    index, 0, getDimension() - 1);
+            throw new MatrixIndexException(LocalizedFormats.INDEX_OUT_OF_RANGE,
+                                           index, 0, getDimension() - 1);
         }
     }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixIndexExceptionTest.java?rev=981243&r1=981242&r2=981243&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
Sun Aug  1 15:16:54 2010
@@ -17,6 +17,8 @@
 
 package org.apache.commons.math.linear;
 
+import org.apache.commons.math.util.LocalizedFormats;
+
 import junit.framework.TestCase;
 
 /**
@@ -27,9 +29,10 @@ public class MatrixIndexExceptionTest ex
     /**
      *
      */
-    public void testConstructorMessage(){
-        String msg = "message";
-        MatrixIndexException ex = new MatrixIndexException(msg);
-        assertEquals(msg, ex.getMessage());
+    public void testParameter(){
+        MatrixIndexException ex = new MatrixIndexException(LocalizedFormats.INDEX_OUT_OF_RANGE,
12, 0, 5);
+        assertEquals(12, ex.getArguments()[0]);
+        assertEquals(0,  ex.getArguments()[1]);
+        assertEquals(5,  ex.getArguments()[2]);
     }
 }



Mime
View raw message