commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r506600 - in /jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math: analysis/UnivariateRealSolverUtils.java distribution/AbstractContinuousDistribution.java util/DefaultTransformer.java
Date Mon, 12 Feb 2007 19:35:59 GMT
Author: luc
Date: Mon Feb 12 11:35:59 2007
New Revision: 506600

URL: http://svn.apache.org/viewvc?view=rev&rev=506600
Log:
use properly the top level exceptions for too specific cases which don't need a devoted exception
class

Modified:
    jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
    jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
    jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java

Modified: jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java?view=diff&rev=506600&r1=506599&r2=506600
==============================================================================
--- jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
(original)
+++ jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/analysis/UnivariateRealSolverUtils.java
Mon Feb 12 11:35:59 2007
@@ -198,11 +198,10 @@
    
         if (fa * fb >= 0.0 ) {
             throw new ConvergenceException
-            ("Number of iterations= " + numIterations +
-              " maximum iterations= "  + maximumIterations +
-              " initial= " + initial + " lowerBound=" + lowerBound +
-              " upperBound=" + upperBound + " final a value=" + a +
-              " final b value=" + b + " f(a)=" + fa + " f(b)=" + fb);
+            ("Number of iterations={0}, maximum iterations={1}, initial={2}, lower bound={3},
upper bound={4}, final a value={5}, final b value={6}, f(a)={7}, f(b)={8}",
+             new Object[] { new Integer(numIterations), new Integer(maximumIterations),
+                            new Double(initial), new Double(lowerBound), new Double(upperBound),
+                            new Double(a), new Double(b), new Double(fa), new Double(fb)
});
         }
         
         return new double[]{a, b};

Modified: jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java?view=diff&rev=506600&r1=506599&r2=506600
==============================================================================
--- jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
(original)
+++ jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
Mon Feb 12 11:35:59 2007
@@ -71,8 +71,7 @@
                 try {
                     return cumulativeProbability(x) - p;
                 } catch (MathException ex) {
-                    throw new FunctionEvaluationException
-                        (x, "Error computing cdf", ex);
+                    throw new FunctionEvaluationException(x, ex.getPattern(), ex.getArguments(),
ex);
                 }
             }
         };

Modified: jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java?view=diff&rev=506600&r1=506599&r2=506600
==============================================================================
--- jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java
(original)
+++ jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java
Mon Feb 12 11:35:59 2007
@@ -44,7 +44,7 @@
     public double transform(Object o) throws MathException{
 
         if (o == null) {
-            throw new MathException("Conversion Exception in Transformation, Object is null");
+            throw new MathException("Conversion Exception in Transformation, Object is null",
new Object[0]);
         }
 
         if (o instanceof Number) {
@@ -54,7 +54,8 @@
         try {
             return new Double(o.toString()).doubleValue();
         } catch (Exception e) {
-            throw new MathException("Conversion Exception in Transformation: " + e.getMessage(),
e);
+            throw new MathException("Conversion Exception in Transformation: {0}",
+                                    new Object[] { e.getMessage() }, e);
         }
     }
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message