replaced RuntimeException by MathRuntimeException
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_0@710171 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e8e88d916
commit
ea15217793
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import org.apache.commons.math.MathRuntimeException;
|
||||||
import org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator;
|
import org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator;
|
||||||
import org.apache.commons.math.ode.sampling.StepHandler;
|
import org.apache.commons.math.ode.sampling.StepHandler;
|
||||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||||
|
@ -314,8 +315,7 @@ public class ContinuousOutputModel
|
||||||
steps.get(index).setInterpolatedTime(time);
|
steps.get(index).setInterpolatedTime(time);
|
||||||
|
|
||||||
} catch (DerivativeException de) {
|
} catch (DerivativeException de) {
|
||||||
throw new RuntimeException("unexpected DerivativeException caught: " +
|
throw new MathRuntimeException("unexpected exception caught", new Object[0], de);
|
||||||
de.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Comparator;
|
||||||
|
|
||||||
import org.apache.commons.math.ConvergenceException;
|
import org.apache.commons.math.ConvergenceException;
|
||||||
import org.apache.commons.math.DimensionMismatchException;
|
import org.apache.commons.math.DimensionMismatchException;
|
||||||
|
import org.apache.commons.math.MathRuntimeException;
|
||||||
import org.apache.commons.math.linear.RealMatrix;
|
import org.apache.commons.math.linear.RealMatrix;
|
||||||
import org.apache.commons.math.random.CorrelatedRandomVectorGenerator;
|
import org.apache.commons.math.random.CorrelatedRandomVectorGenerator;
|
||||||
import org.apache.commons.math.random.JDKRandomGenerator;
|
import org.apache.commons.math.random.JDKRandomGenerator;
|
||||||
|
@ -269,7 +270,7 @@ public abstract class DirectSearchOptimizer {
|
||||||
|
|
||||||
} catch (DimensionMismatchException dme) {
|
} catch (DimensionMismatchException dme) {
|
||||||
// this should not happen
|
// this should not happen
|
||||||
throw new RuntimeException("internal error");
|
throw new MathRuntimeException("unexpected exception caught", new Object[0], dme);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,19 +17,20 @@
|
||||||
|
|
||||||
package org.apache.commons.math.random;
|
package org.apache.commons.math.random;
|
||||||
|
|
||||||
import java.io.EOFException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileReader;
|
import java.io.EOFException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
|
import org.apache.commons.math.MathRuntimeException;
|
||||||
import org.apache.commons.math.stat.descriptive.StatisticalSummary;
|
import org.apache.commons.math.stat.descriptive.StatisticalSummary;
|
||||||
|
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements <code>EmpiricalDistribution</code> interface. This implementation
|
* Implements <code>EmpiricalDistribution</code> interface. This implementation
|
||||||
|
@ -110,7 +111,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
|
||||||
da.computeStats();
|
da.computeStats();
|
||||||
fillBinStats(in);
|
fillBinStats(in);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e.getMessage());
|
throw new MathRuntimeException(e);
|
||||||
}
|
}
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
|
@ -418,7 +419,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new RuntimeException("No bin selected");
|
throw new MathRuntimeException("no bin selected", new Object[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.ArrayList;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import org.apache.commons.math.MathRuntimeException;
|
||||||
import org.apache.commons.math.RetryTestCase;
|
import org.apache.commons.math.RetryTestCase;
|
||||||
import org.apache.commons.math.TestUtils;
|
import org.apache.commons.math.TestUtils;
|
||||||
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
|
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
|
||||||
|
@ -141,7 +142,11 @@ public final class EmpiricalDistributionTest extends RetryTestCase {
|
||||||
empiricalDistribution.getNextValue();
|
empiricalDistribution.getNextValue();
|
||||||
empiricalDistribution2.getNextValue();
|
empiricalDistribution2.getNextValue();
|
||||||
fail("Expecting IllegalStateException");
|
fail("Expecting IllegalStateException");
|
||||||
} catch (IllegalStateException ex) {;}
|
} catch (IllegalStateException ex) {
|
||||||
|
// expected
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("wrong exception caught");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,9 +195,10 @@ public final class EmpiricalDistributionTest extends RetryTestCase {
|
||||||
try {
|
try {
|
||||||
dist.load((double[]) null);
|
dist.load((double[]) null);
|
||||||
fail("load((double[]) null) expected RuntimeException");
|
fail("load((double[]) null) expected RuntimeException");
|
||||||
}
|
} catch (MathRuntimeException e) {
|
||||||
catch (RuntimeException e) {
|
|
||||||
// expected
|
// expected
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("wrong exception caught");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,9 +207,10 @@ public final class EmpiricalDistributionTest extends RetryTestCase {
|
||||||
try {
|
try {
|
||||||
dist.load((URL) null);
|
dist.load((URL) null);
|
||||||
fail("load((URL) null) expected NullPointerException");
|
fail("load((URL) null) expected NullPointerException");
|
||||||
}
|
} catch (NullPointerException e) {
|
||||||
catch (NullPointerException e) {
|
|
||||||
// expected
|
// expected
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("wrong exception caught");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,9 +219,10 @@ public final class EmpiricalDistributionTest extends RetryTestCase {
|
||||||
try {
|
try {
|
||||||
dist.load((File) null);
|
dist.load((File) null);
|
||||||
fail("load((File) null) expected NullPointerException");
|
fail("load((File) null) expected NullPointerException");
|
||||||
}
|
} catch (NullPointerException e) {
|
||||||
catch (NullPointerException e) {
|
|
||||||
// expected
|
// expected
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("wrong exception caught");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.apache.commons.math.util;
|
package org.apache.commons.math.util;
|
||||||
|
|
||||||
|
import org.apache.commons.math.MathRuntimeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version $Revision$ $Date$
|
* @version $Revision$ $Date$
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +59,7 @@ public class TestBean {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Double getZ() {
|
public Double getZ() {
|
||||||
throw new RuntimeException();
|
throw new MathRuntimeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue