From 2a2a74e9d5174bd3a7f614ac1507467be077282c Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 4 Nov 2011 10:13:15 +0000 Subject: [PATCH] Tidy throws clauses git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1197481 13f79535-47bb-0310-9956-ffa450edef68 --- .../LegendreGaussIntegratorTest.java | 5 ++--- .../integration/RombergIntegratorTest.java | 5 ++--- .../integration/SimpsonIntegratorTest.java | 5 ++--- .../integration/TrapezoidIntegratorTest.java | 5 ++--- .../math/distribution/BetaDistributionTest.java | 5 ++--- .../distribution/NormalDistributionTest.java | 3 +-- .../math/distribution/TDistributionTest.java | 5 ++--- .../math/fraction/BigFractionFormatTest.java | 3 +-- .../MillerUpdatingRegressionTest.java | 17 ++++++++--------- 9 files changed, 22 insertions(+), 31 deletions(-) diff --git a/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java index 71c26074c..a7094f296 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java @@ -18,7 +18,6 @@ package org.apache.commons.math.analysis.integration; import java.util.Random; -import org.apache.commons.math.MathException; import org.apache.commons.math.analysis.QuinticFunction; import org.apache.commons.math.analysis.SinFunction; import org.apache.commons.math.analysis.UnivariateRealFunction; @@ -32,7 +31,7 @@ import org.junit.Test; public class LegendreGaussIntegratorTest { @Test - public void testSinFunction() throws MathException { + public void testSinFunction() { UnivariateRealFunction f = new SinFunction(); UnivariateRealIntegratorImpl integrator = new LegendreGaussIntegrator(5, 1.0e-14, 1.0e-10, 2, 15); double min, max, expected, result, tolerance; @@ -51,7 +50,7 @@ public class LegendreGaussIntegratorTest { } @Test - public void testQuinticFunction() throws MathException { + public void testQuinticFunction() { UnivariateRealFunction f = new QuinticFunction(); UnivariateRealIntegrator integrator = new LegendreGaussIntegrator(3, diff --git a/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java index 61fcb2b50..2b63f36e3 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java @@ -16,7 +16,6 @@ */ package org.apache.commons.math.analysis.integration; -import org.apache.commons.math.MathException; import org.apache.commons.math.analysis.QuinticFunction; import org.apache.commons.math.analysis.SinFunction; import org.apache.commons.math.analysis.UnivariateRealFunction; @@ -42,7 +41,7 @@ public final class RombergIntegratorTest { * Test of integrator for the sine function. */ @Test - public void testSinFunction() throws MathException { + public void testSinFunction() { UnivariateRealFunction f = new SinFunction(); UnivariateRealIntegrator integrator = new RombergIntegrator(); double min, max, expected, result, tolerance; @@ -66,7 +65,7 @@ public final class RombergIntegratorTest { * Test of integrator for the quintic function. */ @Test - public void testQuinticFunction() throws MathException { + public void testQuinticFunction() { UnivariateRealFunction f = new QuinticFunction(); UnivariateRealIntegrator integrator = new RombergIntegrator(); double min, max, expected, result, tolerance; diff --git a/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java index e3db301b3..e827d7f7c 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java @@ -16,7 +16,6 @@ */ package org.apache.commons.math.analysis.integration; -import org.apache.commons.math.MathException; import org.apache.commons.math.analysis.QuinticFunction; import org.apache.commons.math.analysis.SinFunction; import org.apache.commons.math.analysis.UnivariateRealFunction; @@ -41,7 +40,7 @@ public final class SimpsonIntegratorTest { * Test of integrator for the sine function. */ @Test - public void testSinFunction() throws MathException { + public void testSinFunction() { UnivariateRealFunction f = new SinFunction(); UnivariateRealIntegrator integrator = new SimpsonIntegrator(); double min, max, expected, result, tolerance; @@ -65,7 +64,7 @@ public final class SimpsonIntegratorTest { * Test of integrator for the quintic function. */ @Test - public void testQuinticFunction() throws MathException { + public void testQuinticFunction() { UnivariateRealFunction f = new QuinticFunction(); UnivariateRealIntegrator integrator = new SimpsonIntegrator(); double min, max, expected, result, tolerance; diff --git a/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java index 45bdc7b06..4d19b9a38 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java @@ -16,7 +16,6 @@ */ package org.apache.commons.math.analysis.integration; -import org.apache.commons.math.MathException; import org.apache.commons.math.analysis.QuinticFunction; import org.apache.commons.math.analysis.SinFunction; import org.apache.commons.math.analysis.UnivariateRealFunction; @@ -41,7 +40,7 @@ public final class TrapezoidIntegratorTest { * Test of integrator for the sine function. */ @Test - public void testSinFunction() throws MathException { + public void testSinFunction() { UnivariateRealFunction f = new SinFunction(); UnivariateRealIntegrator integrator = new TrapezoidIntegrator(); double min, max, expected, result, tolerance; @@ -65,7 +64,7 @@ public final class TrapezoidIntegratorTest { * Test of integrator for the quintic function. */ @Test - public void testQuinticFunction() throws MathException { + public void testQuinticFunction() { UnivariateRealFunction f = new QuinticFunction(); UnivariateRealIntegrator integrator = new TrapezoidIntegrator(); double min, max, expected, result, tolerance; diff --git a/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java b/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java index 4970eeef1..f4f9d3814 100644 --- a/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java +++ b/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java @@ -16,13 +16,12 @@ */ package org.apache.commons.math.distribution; -import org.apache.commons.math.MathException; import org.junit.Assert; import org.junit.Test; public class BetaDistributionTest { @Test - public void testCumulative() throws MathException { + public void testCumulative() { double[] x = new double[]{-0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1}; // all test data computed using R 2.5 checkCumulative(0.1, 0.1, @@ -141,7 +140,7 @@ public class BetaDistributionTest { } - private void checkCumulative(double alpha, double beta, double[] x, double[] cumes) throws MathException { + private void checkCumulative(double alpha, double beta, double[] x, double[] cumes) { BetaDistribution d = new BetaDistributionImpl(alpha, beta); for (int i = 0; i < x.length; i++) { Assert.assertEquals(cumes[i], d.cumulativeProbability(x[i]), 1e-8); diff --git a/src/test/java/org/apache/commons/math/distribution/NormalDistributionTest.java b/src/test/java/org/apache/commons/math/distribution/NormalDistributionTest.java index ec40bc17e..0246209ca 100644 --- a/src/test/java/org/apache/commons/math/distribution/NormalDistributionTest.java +++ b/src/test/java/org/apache/commons/math/distribution/NormalDistributionTest.java @@ -17,7 +17,6 @@ package org.apache.commons.math.distribution; -import org.apache.commons.math.MathException; import org.apache.commons.math.exception.NotStrictlyPositiveException; import org.junit.Assert; import org.junit.Test; @@ -180,7 +179,7 @@ public class NormalDistributionTest extends ContinuousDistributionAbstractTest } @Test - public void testMath280() throws MathException { + public void testMath280() { NormalDistribution normal = new NormalDistributionImpl(0,1); double result = normal.inverseCumulativeProbability(0.9986501019683698); Assert.assertEquals(3.0, result, defaultTolerance); diff --git a/src/test/java/org/apache/commons/math/distribution/TDistributionTest.java b/src/test/java/org/apache/commons/math/distribution/TDistributionTest.java index 5d5a0f422..2bedadfdf 100644 --- a/src/test/java/org/apache/commons/math/distribution/TDistributionTest.java +++ b/src/test/java/org/apache/commons/math/distribution/TDistributionTest.java @@ -19,7 +19,6 @@ package org.apache.commons.math.distribution; import org.apache.commons.math.exception.NotStrictlyPositiveException; import org.junit.Assert; import org.junit.Test; -import org.apache.commons.math.MathException; import org.apache.commons.math.TestUtils; /** * Test cases for TDistribution. @@ -144,7 +143,7 @@ public class TDistributionTest extends ContinuousDistributionAbstractTest { * Have chosen problevels from 0.10 to 0.001 */ @Test - public void nistData() throws MathException{ + public void nistData(){ double[] prob = new double[]{ 0.10,0.05,0.025,0.01,0.005,0.001}; double[] args2 = new double[]{1.886,2.920,4.303,6.965,9.925,22.327}; double[] args10 = new double[]{1.372,1.812,2.228,2.764,3.169,4.143}; @@ -156,7 +155,7 @@ public class TDistributionTest extends ContinuousDistributionAbstractTest { TestUtils.assertEquals(prob, makeNistResults(args100, 100), 1.0e-4); return; } - private double[] makeNistResults(double[] args, int df) throws MathException{ + private double[] makeNistResults(double[] args, int df){ TDistribution td = new TDistributionImpl(df); double[] res = new double[ args.length ]; for( int i = 0 ; i < res.length ; i++){ diff --git a/src/test/java/org/apache/commons/math/fraction/BigFractionFormatTest.java b/src/test/java/org/apache/commons/math/fraction/BigFractionFormatTest.java index 4552872c8..23483777b 100644 --- a/src/test/java/org/apache/commons/math/fraction/BigFractionFormatTest.java +++ b/src/test/java/org/apache/commons/math/fraction/BigFractionFormatTest.java @@ -20,7 +20,6 @@ package org.apache.commons.math.fraction; import java.math.BigDecimal; import java.math.BigInteger; import java.text.NumberFormat; -import java.text.ParseException; import java.util.Locale; import org.apache.commons.math.exception.MathParseException; @@ -269,7 +268,7 @@ public class BigFractionFormatTest { } @Test - public void testParseBig() throws ParseException { + public void testParseBig() { BigFraction f1 = improperFormat.parse("167213075789791382630275400487886041651764456874403" + " / " + diff --git a/src/test/java/org/apache/commons/math/stat/regression/MillerUpdatingRegressionTest.java b/src/test/java/org/apache/commons/math/stat/regression/MillerUpdatingRegressionTest.java index 36a0ec701..521bdb054 100644 --- a/src/test/java/org/apache/commons/math/stat/regression/MillerUpdatingRegressionTest.java +++ b/src/test/java/org/apache/commons/math/stat/regression/MillerUpdatingRegressionTest.java @@ -18,7 +18,6 @@ package org.apache.commons.math.stat.regression; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.stat.correlation.PearsonsCorrelation; -import org.apache.commons.math.MathException; import org.apache.commons.math.TestUtils; import org.apache.commons.math.util.FastMath; import org.junit.Test; @@ -233,7 +232,7 @@ public class MillerUpdatingRegressionTest { } @Test - public void testFilippelli() throws MathException { + public void testFilippelli() { double[] data = new double[]{ 0.8116, -6.860120914, 0.9072, -4.324130045, @@ -385,7 +384,7 @@ public class MillerUpdatingRegressionTest { } @Test - public void testWampler1() throws MathException { + public void testWampler1() { double[] data = new double[]{ 1, 0, 6, 1, @@ -445,7 +444,7 @@ public class MillerUpdatingRegressionTest { } @Test - public void testWampler2() throws MathException { + public void testWampler2() { double[] data = new double[]{ 1.00000, 0, 1.11111, 1, @@ -504,7 +503,7 @@ public class MillerUpdatingRegressionTest { } @Test - public void testWampler3() throws MathException { + public void testWampler3() { double[] data = new double[]{ 760, 0, -2042, 1, @@ -561,7 +560,7 @@ public class MillerUpdatingRegressionTest { } //@Test - public void testWampler4() throws MathException { + public void testWampler4() { double[] data = new double[]{ 75901, 0, -204794, 1, @@ -759,7 +758,7 @@ public class MillerUpdatingRegressionTest { // } @Test - public void testOneRedundantColumn() throws MathException { + public void testOneRedundantColumn() { MillerUpdatingRegression instance = new MillerUpdatingRegression(4, false); MillerUpdatingRegression instance2 = new MillerUpdatingRegression(5, false); double[][] x = new double[airdata[0].length][]; @@ -822,7 +821,7 @@ public class MillerUpdatingRegressionTest { } @Test - public void testThreeRedundantColumn() throws MathException { + public void testThreeRedundantColumn() { MillerUpdatingRegression instance = new MillerUpdatingRegression(4, false); MillerUpdatingRegression instance2 = new MillerUpdatingRegression(7, false); @@ -1061,7 +1060,7 @@ public class MillerUpdatingRegressionTest { @Test - public void testSubsetRegression() throws MathException { + public void testSubsetRegression() { MillerUpdatingRegression instance = new MillerUpdatingRegression(3, true); MillerUpdatingRegression redRegression = new MillerUpdatingRegression(2, true);