From accccd996a2ca8f450e7206cb1c9e4c64e53f1cd Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sun, 1 Aug 2010 15:01:30 +0000 Subject: [PATCH] fixed another bunch of checkstyle warnings git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@981238 13f79535-47bb-0310-9956-ffa450edef68 --- .../MicrosphereInterpolatingFunction.java | 2 +- .../general/BaseAbstractScalarOptimizer.java | 5 ++-- .../AbstractUnivariateRealOptimizer.java | 28 +++++++++--------- .../univariate/BracketFinder.java | 29 +++++++++++++++++++ .../apache/commons/math/util/MathUtils.java | 12 ++++++-- .../math/util/MultidimensionalCounter.java | 24 +++++++-------- 6 files changed, 69 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java b/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java index 97822b7b1..157a9e488 100644 --- a/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java @@ -148,7 +148,7 @@ public class MicrosphereInterpolatingFunction int brightnessExponent, int microsphereElements, UnitSphereRandomVectorGenerator rand) - throws DimensionMismatchException, IllegalArgumentException { + throws DimensionMismatchException, NoDataException { if (xval.length == 0 || xval[0] == null) { throw new NoDataException(); } diff --git a/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java b/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java index e9f9269f8..20318f8c9 100644 --- a/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java @@ -37,6 +37,7 @@ import org.apache.commons.math.optimization.SimpleScalarValueChecker; * A class that implements an optimization algorithm should inherit from * {@link AbstractScalarOptimizer} or from * {@link AbstractScalarDifferentiableOptimizer}. + * @param the type of the objective function to be optimized * * @version $Revision$ $Date$ * @since 2.2 @@ -120,8 +121,8 @@ public abstract class BaseAbstractScalarOptimizer { * of the iterator. * @throws IndexOutOfBoundsException if {@code index} is not in the * correct interval (as defined by the length of the argument in the - * {@link #MultidimensionalCounter(int[]) + * {@link MultidimensionalCounter#MultidimensionalCounter(int[]) * constructor of the enclosing class}). */ public int getCount(int dim) { @@ -159,7 +159,7 @@ public class MultidimensionalCounter implements Iterable { * Create a counter. * * @param size Counter sizes (number of slots in each dimension). - * @throws {@link NotStrictlyPositiveException} if one of the sizes is + * @throws NotStrictlyPositiveException if one of the sizes is * negative or zero. */ public MultidimensionalCounter(int ... size) { @@ -210,12 +210,12 @@ public class MultidimensionalCounter implements Iterable { * * @param index Index in unidimensional counter. * @return the multidimensional counts. - * @throws {@link OutOfRangeException} if {@code index} is not between + * @throws OutOfRangeException if {@code index} is not between * {@code 0} and the value returned by {@link #getSize()} (excluded). */ public int[] getCounts(int index) { - if (index < 0 - || index >= totalSize) { + if (index < 0 || + index >= totalSize) { throw new OutOfRangeException(index, 0, totalSize); } @@ -250,21 +250,21 @@ public class MultidimensionalCounter implements Iterable { * * @param c Indices in multidimensional counter. * @return the index within the unidimensionl counter. - * @throws {@link DimensionMismatchException} if the size of {@code c} - * does not match the size of the array given in the contructor. - * @throws {@link OutOfRangeException} if a value of {@code c} is not in + * @throws DimensionMismatchException if the size of {@code c} + * does not match the size of the array given in the constructor. + * @throws OutOfRangeException if a value of {@code c} is not in * the range of the corresponding dimension, as defined in the - * {@link #MultidimensionalCounter(int[]) constructor}. + * {@link MultidimensionalCounter#MultidimensionalCounter(int...) constructor}. */ - public int getCount(int ... c) { + public int getCount(int ... c) throws OutOfRangeException { if (c.length != dimension) { throw new DimensionMismatchException(c.length, dimension); } int count = 0; for (int i = 0; i < dimension; i++) { final int index = c[i]; - if (index < 0 - || index >= size[i]) { + if (index < 0 || + index >= size[i]) { throw new OutOfRangeException(index, 0, size[i] - 1); } count += uniCounterOffset[i] * c[i];