Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 62788 invoked from network); 5 Apr 2009 16:56:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2009 16:56:23 -0000 Received: (qmail 7893 invoked by uid 500); 5 Apr 2009 16:56:23 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 7814 invoked by uid 500); 5 Apr 2009 16:56:22 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 7805 invoked by uid 99); 5 Apr 2009 16:56:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 16:56:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 16:56:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 42C5E238896D; Sun, 5 Apr 2009 16:56:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r762118 - in /commons/proper/math/trunk/src/test/org/apache/commons/math: distribution/ estimation/ linear/ ode/nonstiff/ random/ stat/data/ stat/descriptive/ stat/descriptive/moment/ transform/ util/ Date: Sun, 05 Apr 2009 16:56:00 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090405165601.42C5E238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Sun Apr 5 16:55:59 2009 New Revision: 762118 URL: http://svn.apache.org/viewvc?rev=762118&view=rev Log: Remove unnecessary casts, unnecessary throws and unnecessary semi-colons Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/IntegerDistributionAbstractTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/GaussNewtonEstimatorTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/LevenbergMarquardtEstimatorTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem1.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem2.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem3.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem4.java commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemAbstract.java commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/StandardDeviationTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/VarianceTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastFourierTransformerTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastHadamardTransformerTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/IntegerDistributionAbstractTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/IntegerDistributionAbstractTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/IntegerDistributionAbstractTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/IntegerDistributionAbstractTest.java Sun Apr 5 16:55:59 2009 @@ -196,14 +196,14 @@ */ public void testFloatingPointArguments() throws Exception { for (int i = 0; i < cumulativeTestPoints.length; i++) { - double arg = (double) cumulativeTestPoints[i]; + double arg = cumulativeTestPoints[i]; assertEquals( "Incorrect cumulative probability value returned for " + cumulativeTestPoints[i], cumulativeTestValues[i], distribution.cumulativeProbability(arg), tolerance); if (i < cumulativeTestPoints.length - 1) { - double arg2 = (double) cumulativeTestPoints[i + 1]; + double arg2 = cumulativeTestPoints[i + 1]; assertEquals("Inconsistent probability for discrete range " + "[ " + arg + "," + arg2 + " ]", distribution.cumulativeProbability( @@ -223,9 +223,9 @@ int one = 1; int ten = 10; int two = 2; - double oned = (double) one; - double twod = (double) two; - double tend = (double) ten; + double oned = one; + double twod = two; + double tend = ten; assertEquals(distribution.cumulativeProbability(one, two), distribution.cumulativeProbability(oned, twod), tolerance); assertEquals(distribution.cumulativeProbability(one, two), Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java Sun Apr 5 16:55:59 2009 @@ -149,8 +149,8 @@ distribution.setMean(0); distribution.setStandardDeviation(1); for (int i = 0; i < 100; i+=5) { // make sure no convergence exception - double lowerTail = distribution.cumulativeProbability((double)-i); - double upperTail = distribution.cumulativeProbability((double) i); + double lowerTail = distribution.cumulativeProbability(-i); + double upperTail = distribution.cumulativeProbability(i); if (i < 10) { // make sure not top-coded assertTrue(lowerTail > 0.0d); assertTrue(upperTail < 1.0d); Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/GaussNewtonEstimatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/GaussNewtonEstimatorTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/GaussNewtonEstimatorTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/GaussNewtonEstimatorTest.java Sun Apr 5 16:55:59 2009 @@ -237,7 +237,7 @@ } - public void testNonInversible() throws EstimationException { + public void testNonInversible() { EstimatedParameter[] p = { new EstimatedParameter("p0", 0), @@ -322,7 +322,7 @@ } - public void testMoreEstimatedParametersSimple() throws EstimationException { + public void testMoreEstimatedParametersSimple() { EstimatedParameter[] p = { new EstimatedParameter("p0", 7), @@ -354,7 +354,7 @@ } - public void testMoreEstimatedParametersUnsorted() throws EstimationException { + public void testMoreEstimatedParametersUnsorted() { EstimatedParameter[] p = { new EstimatedParameter("p0", 2), new EstimatedParameter("p1", 2), @@ -516,7 +516,7 @@ assertEquals(48.13516790438953, circle.getY(), 1.0e-10); } - public void testCircleFittingBadInit() throws EstimationException { + public void testCircleFittingBadInit() { Circle circle = new Circle(-12, -12); double[][] points = new double[][] { {-0.312967, 0.072366}, {-0.339248, 0.132965}, {-0.379780, 0.202724}, @@ -637,7 +637,7 @@ } public WeightedMeasurement[] getMeasurements() { - return (WeightedMeasurement[]) points.toArray(new PointModel[points.size()]); + return points.toArray(new PointModel[points.size()]); } public EstimatedParameter[] getAllParameters() { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/LevenbergMarquardtEstimatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/LevenbergMarquardtEstimatorTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/LevenbergMarquardtEstimatorTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/estimation/LevenbergMarquardtEstimatorTest.java Sun Apr 5 16:55:59 2009 @@ -457,7 +457,7 @@ } - public void testControlParameters() throws EstimationException { + public void testControlParameters() { Circle circle = new Circle(98.680, 47.345); circle.addPoint( 30.0, 68.0); circle.addPoint( 50.0, -6.0); @@ -620,7 +620,7 @@ set.add(parameters[j]); } } - return (EstimatedParameter[]) set.toArray(new EstimatedParameter[set.size()]); + return set.toArray(new EstimatedParameter[set.size()]); } private LinearMeasurement[] measurements; @@ -682,7 +682,7 @@ } public WeightedMeasurement[] getMeasurements() { - return (WeightedMeasurement[]) points.toArray(new PointModel[points.size()]); + return points.toArray(new PointModel[points.size()]); } public EstimatedParameter[] getAllParameters() { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java Sun Apr 5 16:55:59 2009 @@ -236,7 +236,7 @@ m.add(m2); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -258,7 +258,7 @@ m.subtract(new BigMatrixImpl(testData2)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -282,7 +282,7 @@ m.multiply(new BigMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -350,32 +350,32 @@ asDouble(m.solve(asBigDecimal(testVector2))); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } BigMatrix bs = new BigMatrixImpl(bigSingular); try { bs.solve(bs); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { - ; + // ignored } try { m.solve(bs); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { new BigMatrixImpl(testData2).solve(bs); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { (new BigMatrixImpl(testData2)).luDecompose(); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { - ; + // ignored } } @@ -396,7 +396,7 @@ new BigMatrixImpl(testData2).getDeterminant().doubleValue(); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { - ; + // ignored } } @@ -409,7 +409,7 @@ m.getTrace().doubleValue(); fail("Expecting NonSquareMatrixException"); } catch (NonSquareMatrixException ex) { - ; + // ignored } } @@ -430,7 +430,7 @@ asDouble(m.operate(asBigDecimal(testVector))); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -467,7 +467,7 @@ m.preMultiply(asBigDecimal(testVector)); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -493,7 +493,7 @@ m.preMultiply(new BigMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -505,24 +505,24 @@ m.getRowAsDoubleArray(10); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { - ; + // ignored } try { m.getColumnAsDoubleArray(-1); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { - ; + // ignored } } public void testLUDecomposition() throws Exception { BigMatrixImpl m = new BigMatrixImpl(testData); BigMatrix lu = m.getLUMatrix(); - assertClose("LU decomposition", lu, (BigMatrix) new BigMatrixImpl(testDataLU), normTolerance); + assertClose("LU decomposition", lu, new BigMatrixImpl(testDataLU), normTolerance); verifyDecomposition(m, lu); m = new BigMatrixImpl(luData); lu = m.getLUMatrix(); - assertClose("LU decomposition", lu, (BigMatrix) new BigMatrixImpl(luDataLUDecomposition), normTolerance); + assertClose("LU decomposition", lu, new BigMatrixImpl(luDataLUDecomposition), normTolerance); verifyDecomposition(m, lu); m = new BigMatrixImpl(testDataMinus); lu = m.getLUMatrix(); Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java Sun Apr 5 16:55:59 2009 @@ -132,11 +132,11 @@ } public void testCreateRowBigMatrix() { - assertEquals((BigMatrixImpl) MatrixUtils.createRowBigMatrix(row), + assertEquals(MatrixUtils.createRowBigMatrix(row), new BigMatrixImpl(rowMatrix)); - assertEquals((BigMatrixImpl) MatrixUtils.createRowBigMatrix(bigRow), + assertEquals(MatrixUtils.createRowBigMatrix(bigRow), new BigMatrixImpl(bigRowMatrix)); - assertEquals((BigMatrixImpl) MatrixUtils.createRowBigMatrix(stringRow), + assertEquals(MatrixUtils.createRowBigMatrix(stringRow), new BigMatrixImpl(stringRowMatrix)); try { MatrixUtils.createRowBigMatrix(new double[] {}); // empty @@ -170,11 +170,11 @@ } public void testCreateColumnBigMatrix() { - assertEquals((BigMatrixImpl) MatrixUtils.createColumnBigMatrix(col), + assertEquals(MatrixUtils.createColumnBigMatrix(col), new BigMatrixImpl(colMatrix)); - assertEquals((BigMatrixImpl) MatrixUtils.createColumnBigMatrix(bigCol), + assertEquals(MatrixUtils.createColumnBigMatrix(bigCol), new BigMatrixImpl(bigColMatrix)); - assertEquals((BigMatrixImpl) MatrixUtils.createColumnBigMatrix(stringCol), + assertEquals(MatrixUtils.createColumnBigMatrix(stringCol), new BigMatrixImpl(stringColMatrix)); try { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java Sun Apr 5 16:55:59 2009 @@ -63,7 +63,7 @@ double t0 = 0; double[] y0 = {0.0, 1.0, -2.0}; - double[] y = (double[]) y0.clone(); + double[] y = y0.clone(); double[][] yDot = { new double[y0.length] }; EulerStepInterpolator interpolator = new EulerStepInterpolator(); interpolator.reinitialize(new DummyEquations(), y, yDot, true); Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem1.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem1.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem1.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem1.java Sun Apr 5 16:55:59 2009 @@ -59,7 +59,7 @@ */ public TestProblem1(TestProblem1 problem) { super(problem); - y = (double[]) problem.y.clone(); + y = problem.y.clone(); } /** Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem2.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem2.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem2.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem2.java Sun Apr 5 16:55:59 2009 @@ -60,7 +60,7 @@ */ public TestProblem2(TestProblem2 problem) { super(problem); - y = (double[]) problem.y.clone(); + y = problem.y.clone(); } /** Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem3.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem3.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem3.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem3.java Sun Apr 5 16:55:59 2009 @@ -75,7 +75,7 @@ public TestProblem3(TestProblem3 problem) { super(problem); e = problem.e; - y = (double[]) problem.y.clone(); + y = problem.y.clone(); } /** Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem4.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem4.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem4.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblem4.java Sun Apr 5 16:55:59 2009 @@ -65,7 +65,7 @@ public TestProblem4(TestProblem4 problem) { super(problem); a = problem.a; - y = (double[]) problem.y.clone(); + y = problem.y.clone(); } /** Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemAbstract.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemAbstract.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemAbstract.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/TestProblemAbstract.java Sun Apr 5 16:55:59 2009 @@ -71,12 +71,12 @@ if (problem.y0 == null) { y0 = null; } else { - y0 = (double[]) problem.y0.clone(); + y0 = problem.y0.clone(); } if (problem.errorScale == null) { errorScale = null; } else { - errorScale = (double[]) problem.errorScale.clone(); + errorScale = problem.errorScale.clone(); } t1 = problem.t1; } @@ -97,7 +97,7 @@ calls = 0; n = y0.length; this.t0 = t0; - this.y0 = (double[]) y0.clone(); + this.y0 = y0.clone(); } /** @@ -113,7 +113,7 @@ * @param errorScale error scale */ protected void setErrorScale(double[] errorScale) { - this.errorScale = (double[]) errorScale.clone(); + this.errorScale = errorScale.clone(); } public int getDimension() { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java Sun Apr 5 16:55:59 2009 @@ -18,8 +18,6 @@ import junit.framework.Test; import junit.framework.TestSuite; -import java.security.NoSuchProviderException; -import java.security.NoSuchAlgorithmException; import java.util.HashSet; import org.apache.commons.math.RetryTestCase; @@ -72,7 +70,7 @@ randomData.nextInt(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { - ; + // ignored } Frequency freq = new Frequency(); int value = 0; @@ -99,7 +97,7 @@ randomData.nextLong(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { - ; + // ignored } Frequency freq = new Frequency(); long value = 0; @@ -126,7 +124,7 @@ randomData.nextSecureLong(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { - ; + // ignored } Frequency freq = new Frequency(); long value = 0; @@ -153,7 +151,7 @@ randomData.nextSecureInt(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { - ; + // ignored } Frequency freq = new Frequency(); int value = 0; @@ -185,7 +183,7 @@ randomData.nextPoisson(0); fail("zero mean -- expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } Frequency f = new Frequency(); for (int i = 0; i set size, expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } // Make sure we fail for empty collection @@ -530,7 +527,7 @@ one = randomData.nextSample(hs,0); fail("n = k = 0, expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } @@ -577,7 +574,7 @@ perm = randomData.nextPermutation(2,3); fail("permutation k > n, expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } // Make sure we fail for n = 0 @@ -585,7 +582,7 @@ perm = randomData.nextPermutation(0,0); fail("permutation k = n = 0, expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } // Make sure we fail for k < n < 0 @@ -593,7 +590,7 @@ perm = randomData.nextPermutation(-1,-3); fail("permutation k < n < 0, expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } } Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/CertifiedDataAbstractTest.java Sun Apr 5 16:55:59 2009 @@ -112,7 +112,7 @@ public void testCertifiedValues() { for (String name : certifiedValues.keySet()) { - Double expectedValue = (Double)certifiedValues.get(name); + Double expectedValue = certifiedValues.get(name); Double summariesValue = getProperty(summaries, name); if (summariesValue != null) { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java Sun Apr 5 16:55:59 2009 @@ -183,11 +183,11 @@ StorelessUnivariateStatistic replica = null; // Randomly select a portion of testArray to load first - long index = Math.round((Math.random()) * (double) testArray.length); + long index = Math.round((Math.random()) * testArray.length); // Put first half in master and copy master to replica master.incrementAll(testArray, 0, (int) index); - replica = (StorelessUnivariateStatistic) master.copy(); + replica = master.copy(); // Check same assertTrue(replica.equals(master)); Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/StandardDeviationTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/StandardDeviationTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/StandardDeviationTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/StandardDeviationTest.java Sun Apr 5 16:55:59 2009 @@ -101,7 +101,7 @@ for (int i = 0; i < v.length; i++) { sum += (v[i] - mean) * (v[i] - mean); } - return Math.sqrt(sum / (double) v.length); + return Math.sqrt(sum / v.length); } } Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/VarianceTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/VarianceTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/VarianceTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/moment/VarianceTest.java Sun Apr 5 16:55:59 2009 @@ -100,7 +100,7 @@ for (int i = 0; i < v.length; i++) { sum += (v[i] - mean) * (v[i] - mean); } - return sum / (double) v.length; + return sum / v.length; } } Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastFourierTransformerTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastFourierTransformerTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastFourierTransformerTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastFourierTransformerTest.java Sun Apr 5 16:55:59 2009 @@ -34,7 +34,7 @@ /** * Test of transformer for the ad hoc data taken from Mathematica. */ - public void testAdHocData() throws MathException { + public void testAdHocData() { FastFourierTransformer transformer = new FastFourierTransformer(); Complex result[]; double tolerance = 1E-12; @@ -78,7 +78,7 @@ } } - public void test2DData() throws MathException { + public void test2DData() { FastFourierTransformer transformer = new FastFourierTransformer(); double tolerance = 1E-12; Complex[][] input = new Complex[][] {new Complex[] {new Complex(1, 0), Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastHadamardTransformerTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastHadamardTransformerTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastHadamardTransformerTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/transform/FastHadamardTransformerTest.java Sun Apr 5 16:55:59 2009 @@ -77,7 +77,7 @@ // check double transform double[] dX = new double[x.length]; for (int i = 0; i < dX.length; ++i) { - dX[i] = (double) x[i]; + dX[i] = x[i]; } double dResult[] = transformer.transform(dX); for (int i = 0; i < dResult.length; i++) { @@ -106,7 +106,7 @@ // check double transform double[] dY = new double[y.length]; for (int i = 0; i < dY.length; ++i) { - dY[i] = (double) y[i]; + dY[i] = y[i]; } double dResult[] = transformer.inversetransform(dY); for (int i = 0; i < dResult.length; i++) { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java?rev=762118&r1=762117&r2=762118&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java Sun Apr 5 16:55:59 2009 @@ -170,8 +170,8 @@ for (int n = 1; n < 10; n++) { for (int k = 0; k <= n; k++) { assertEquals(n + " choose " + k, binomialCoefficient(n, k), MathUtils.binomialCoefficient(n, k)); - assertEquals(n + " choose " + k, (double)binomialCoefficient(n, k), MathUtils.binomialCoefficientDouble(n, k), Double.MIN_VALUE); - assertEquals(n + " choose " + k, Math.log((double)binomialCoefficient(n, k)), MathUtils.binomialCoefficientLog(n, k), 10E-12); + assertEquals(n + " choose " + k, binomialCoefficient(n, k), MathUtils.binomialCoefficientDouble(n, k), Double.MIN_VALUE); + assertEquals(n + " choose " + k, Math.log(binomialCoefficient(n, k)), MathUtils.binomialCoefficientLog(n, k), 10E-12); } } @@ -181,7 +181,7 @@ long expected = binomialCoefficient(n[i], k[i]); assertEquals(n[i] + " choose " + k[i], expected, MathUtils.binomialCoefficient(n[i], k[i])); - assertEquals(n[i] + " choose " + k[i], (double) expected, + assertEquals(n[i] + " choose " + k[i], expected, MathUtils.binomialCoefficientDouble(n[i], k[i]), 0.0); assertEquals("log(" + n[i] + " choose " + k[i] + ")", Math.log(expected), MathUtils.binomialCoefficientLog(n[i], k[i]), 0.0); @@ -253,53 +253,53 @@ MathUtils.binomialCoefficient(4, 5); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficientDouble(4, 5); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficientLog(4, 5); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficient(-1, -2); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficientDouble(-1, -2); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficientLog(-1, -2); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.binomialCoefficient(67, 30); fail("expecting ArithmeticException"); } catch (ArithmeticException ex) { - ; + // ignored } try { MathUtils.binomialCoefficient(67, 34); fail("expecting ArithmeticException"); } catch (ArithmeticException ex) { - ; + // ignored } double x = MathUtils.binomialCoefficientDouble(1030, 515); assertTrue("expecting infinite binomial coefficient", Double @@ -378,8 +378,8 @@ public void testFactorial() { for (int i = 1; i < 21; i++) { assertEquals(i + "! ", factorial(i), MathUtils.factorial(i)); - assertEquals(i + "! ", (double)factorial(i), MathUtils.factorialDouble(i), Double.MIN_VALUE); - assertEquals(i + "! ", Math.log((double)factorial(i)), MathUtils.factorialLog(i), 10E-12); + assertEquals(i + "! ", factorial(i), MathUtils.factorialDouble(i), Double.MIN_VALUE); + assertEquals(i + "! ", Math.log(factorial(i)), MathUtils.factorialLog(i), 10E-12); } assertEquals("0", 1, MathUtils.factorial(0)); @@ -392,25 +392,25 @@ MathUtils.factorial(-1); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.factorialDouble(-1); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.factorialLog(-1); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { - ; + // ignored } try { MathUtils.factorial(21); fail("expecting ArithmeticException"); } catch (ArithmeticException ex) { - ; + // ignored } assertTrue("expecting infinite factorial value", Double.isInfinite(MathUtils.factorialDouble(171))); } @@ -515,7 +515,7 @@ // Generate 10 distinct random values for (int i = 0; i < 10; i++) { - original[i] = random.nextUniform((double)i + 0.5, (double)i + 0.75); + original[i] = random.nextUniform(i + 0.5, i + 0.75); } // Generate a random permutation, making sure it is not the identity @@ -556,9 +556,9 @@ } public void testIndicatorInt() { - assertEquals((int)1, MathUtils.indicator((int)(2))); - assertEquals((int)1, MathUtils.indicator((int)(0))); - assertEquals((int)(-1), MathUtils.indicator((int)(-2))); + assertEquals(1, MathUtils.indicator((2))); + assertEquals(1, MathUtils.indicator((0))); + assertEquals((-1), MathUtils.indicator((-2))); } public void testIndicatorLong() { @@ -999,9 +999,9 @@ } public void testSignInt() { - assertEquals((int) 1, MathUtils.sign((int) 2)); - assertEquals((int) 0, MathUtils.sign((int) 0)); - assertEquals((int) (-1), MathUtils.sign((int) (-2))); + assertEquals(1, MathUtils.sign(2)); + assertEquals(0, MathUtils.sign(0)); + assertEquals((-1), MathUtils.sign((-2))); } public void testSignLong() {