Author: erans
Date: Fri Nov 12 16:36:57 2010
New Revision: 1034457

URL: http://svn.apache.org/viewvc?rev=1034457&view=rev
Log:
MATH-440
New exception "MathUserException" supersedes "FunctionEvaluationException",
"MatrixVisitorException" and "DerivativeException".

Added:
    
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java
   (with props)
Modified:
    
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/FunctionEvaluationException.java
    
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java
    
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/DerivativeException.java
    commons/proper/math/branches/MATH_2_X/src/site/xdoc/changes.xml

Modified: 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/FunctionEvaluationException.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/FunctionEvaluationException.java?rev=1034457&r1=1034456&r2=1034457&view=diff
==============================================================================
--- 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/FunctionEvaluationException.java
 (original)
+++ 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/FunctionEvaluationException.java
 Fri Nov 12 16:36:57 2010
@@ -28,6 +28,8 @@ import org.apache.commons.math.linear.Ar
  * caused the function evaluation to fail.
  *
  * @version $Revision$ $Date$
+ * @deprecated in 2.2 (to be removed in 3.0). Please use
+ * {...@link org.apache.commons.math.exception.MathUserException} instead.
  */
 public class FunctionEvaluationException extends MathException  {
 

Added: 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java?rev=1034457&view=auto
==============================================================================
--- 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java
 (added)
+++ 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java
 Fri Nov 12 16:36:57 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.exception;
+
+/**
+ * This class is intended as a sort of communication channel between
+ * layers of <em>user</em> code separated from each other by calls to
+ * the Commons-Math library.
+ * The Commons-Math code will never catch such an exception.
+ *
+ * @since 2.2
+ * @version $Revision$ $Date$
+ */
+public class MathUserException extends RuntimeException {
+    /**
+     * Default constructor.
+     */
+    public MathUserException() {}
+
+    /**
+     * @param msg Error message.
+     */
+    public MathUserException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * @param msg Error message.
+     * @param cause Cause of the error.
+     */
+    public MathUserException(String msg,
+                             Throwable cause) {
+        super(msg, cause);
+    }
+
+    /**
+     * @param cause Cause of the error.
+     */
+    public MathUserException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/exception/MathUserException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java?rev=1034457&r1=1034456&r2=1034457&view=diff
==============================================================================
--- 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java
 (original)
+++ 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/linear/MatrixVisitorException.java
 Fri Nov 12 16:36:57 2010
@@ -23,6 +23,8 @@ import org.apache.commons.math.exception
 /**
  * Thrown when a visitor encounters an error while processing a matrix entry.
  * @version $Revision$ $Date$
+ * @deprecated in 2.2 (to be removed in 3.0). Please use
+ * {...@link org.apache.commons.math.exception.MathUserException} instead.
  */
 public class MatrixVisitorException extends MathRuntimeException {
 

Modified: 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/DerivativeException.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/DerivativeException.java?rev=1034457&r1=1034456&r2=1034457&view=diff
==============================================================================
--- 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/DerivativeException.java
 (original)
+++ 
commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/ode/DerivativeException.java
 Fri Nov 12 16:36:57 2010
@@ -27,6 +27,8 @@ import org.apache.commons.math.exception
  * the differential equations.
  * @version $Revision$ $Date$
  * @since 1.2
+ * @deprecated in 2.2 (to be removed in 3.0). Please use
+ * {...@link org.apache.commons.math.exception.MathUserException} instead.
  */
 public class DerivativeException
   extends MathException {

Modified: commons/proper/math/branches/MATH_2_X/src/site/xdoc/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/site/xdoc/changes.xml?rev=1034457&r1=1034456&r2=1034457&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/branches/MATH_2_X/src/site/xdoc/changes.xml Fri Nov 12 
16:36:57 2010
@@ -52,6 +52,12 @@ The <action> type attribute can be add,u
     If the output is not quite correct, check for invisible trailing spaces!
      -->
     <release version="2.2" date="TBD" description="TBD">
+      <action dev="erans" type="add" issue="MATH-440">
+        Created "MathUserException" class to convey cause of failure between
+        layers of user code separated by a layer of Commons-Math code. 
Deprecated
+        classes "FunctionEvaluationException", "MatrixVisitorException" and
+        "DerivativeException".
+      </action>
       <action dev="luc" type="fix" issue="MATH-429">
         Fixed k-means++ to add several strategies to deal with empty clusters 
that may appear
         during iterations


Reply via email to