You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/06/25 16:32:54 UTC

[commons-math] branch master updated (c98e638 -> 7f42535)

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git.


    from c98e638  Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-math
     new f8741d3  MATH-1576: Reinstate checkstyle to legacy module
     new 7f42535  MATH-1576: Fix checkstyle in legacy module

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 commons-math-legacy/pom.xml                        |   1 +
 .../math4/legacy/analysis/FunctionUtils.java       |  12 +-
 .../analysis/differentiation/DSCompiler.java       |   8 +-
 .../differentiation/DerivativeStructure.java       |   6 +-
 .../analysis/differentiation/SparseGradient.java   |  17 +-
 .../math4/legacy/analysis/function/Gaussian.java   |   2 +-
 .../analysis/function/HarmonicOscillator.java      |   2 +-
 .../math4/legacy/analysis/function/Logistic.java   |   2 +-
 .../math4/legacy/analysis/function/Logit.java      |   2 +-
 .../math4/legacy/analysis/function/Sigmoid.java    |   2 +-
 .../BaseAbstractUnivariateIntegrator.java          |   4 +-
 .../analysis/integration/RombergIntegrator.java    |   2 +-
 .../integration/gauss/BaseRuleFactory.java         |   2 +-
 .../integration/gauss/HermiteRuleFactory.java      |   6 +-
 .../BicubicInterpolatingFunction.java              |  18 +-
 .../interpolation/BicubicInterpolator.java         |   8 +-
 .../DividedDifferenceInterpolator.java             |   2 +-
 .../analysis/interpolation/LoessInterpolator.java  |   2 +-
 .../interpolation/NevilleInterpolator.java         |   2 +-
 ...iecewiseBicubicSplineInterpolatingFunction.java |  14 +-
 .../TricubicInterpolatingFunction.java             |  20 +-
 .../interpolation/TricubicInterpolator.java        |   8 +-
 .../analysis/polynomials/PolynomialFunction.java   |   2 +-
 .../PolynomialFunctionLagrangeForm.java            |   7 +-
 .../polynomials/PolynomialSplineFunction.java      |   8 +-
 .../analysis/polynomials/PolynomialsUtils.java     |   6 +-
 .../solvers/BracketingNthOrderBrentSolver.java     |   2 +-
 .../legacy/analysis/solvers/LaguerreSolver.java    |  12 +-
 .../analysis/solvers/UnivariateSolverUtils.java    |   2 +-
 .../legacy/distribution/EmpiricalDistribution.java |  32 +--
 .../MixtureMultivariateRealDistribution.java       |   2 +-
 .../field/linalg/FieldDecompositionSolver.java     |   2 +-
 .../legacy/field/linalg/FieldLUDecomposition.java  |   4 +-
 .../math4/legacy/fitting/GaussianCurveFitter.java  |   2 +-
 .../math4/legacy/fitting/HarmonicCurveFitter.java  |   6 +-
 .../legacy/fitting/PolynomialCurveFitter.java      |   4 +-
 .../math4/legacy/fitting/SimpleCurveFitter.java    |   5 +-
 .../fitting/leastsquares/AbstractEvaluation.java   |   2 +-
 .../leastsquares/DenseWeightedEvaluation.java      |   4 +-
 ...entiatorVectorMultivariateJacobianFunction.java |   2 +-
 .../fitting/leastsquares/GaussNewtonOptimizer.java |   2 +-
 .../fitting/leastsquares/LeastSquaresAdapter.java  |   2 +-
 .../fitting/leastsquares/LeastSquaresBuilder.java  |  14 +-
 .../fitting/leastsquares/LeastSquaresFactory.java  |   6 +-
 .../legacy/fitting/leastsquares/OptimumImpl.java   |   6 +-
 .../leastsquares/ValueAndJacobianFunction.java     |   4 +-
 .../legacy/genetics/AbstractListChromosome.java    |   4 +-
 .../legacy/genetics/ElitisticListPopulation.java   |   2 +-
 .../legacy/genetics/FixedGenerationCount.java      |   4 +-
 .../genetics/InvalidRepresentationException.java   |   2 +-
 .../math4/legacy/genetics/ListPopulation.java      |   6 +-
 .../math4/legacy/genetics/TournamentSelection.java |   2 +-
 .../math4/legacy/linear/AbstractFieldMatrix.java   |  10 +-
 .../math4/legacy/linear/AbstractRealMatrix.java    |   4 +-
 .../math4/legacy/linear/Array2DRowFieldMatrix.java |   6 +-
 .../math4/legacy/linear/Array2DRowRealMatrix.java  |   2 +-
 .../commons/math4/legacy/linear/BigReal.java       |   6 +-
 .../commons/math4/legacy/linear/BigRealField.java  |   4 +-
 .../math4/legacy/linear/BlockRealMatrix.java       |   2 +-
 .../math4/legacy/linear/CholeskyDecomposition.java |   4 +-
 .../math4/legacy/linear/DecompositionSolver.java   |   4 +-
 .../math4/legacy/linear/EigenDecomposition.java    |   6 +-
 .../legacy/linear/FieldDecompositionSolver.java    |   4 +-
 .../math4/legacy/linear/FieldLUDecomposition.java  |   2 +-
 .../commons/math4/legacy/linear/FieldMatrix.java   |   4 +-
 .../math4/legacy/linear/IterationEvent.java        |   2 -
 .../math4/legacy/linear/IterativeLinearSolver.java |   7 +-
 .../math4/legacy/linear/LUDecomposition.java       |   4 +-
 .../commons/math4/legacy/linear/MatrixUtils.java   |   6 +-
 .../legacy/linear/OpenIntToDoubleHashMap.java      |  38 ++--
 .../math4/legacy/linear/OpenIntToFieldHashMap.java |  36 +--
 .../math4/legacy/linear/OpenMapRealMatrix.java     |   2 +-
 .../PreconditionedIterativeLinearSolver.java       |  15 +-
 .../math4/legacy/linear/QRDecomposition.java       |   2 +-
 .../math4/legacy/linear/RRQRDecomposition.java     |   4 +-
 .../math4/legacy/linear/RealLinearOperator.java    |   2 +-
 .../commons/math4/legacy/linear/RealMatrix.java    |   2 +-
 .../math4/legacy/linear/SchurTransformer.java      |   8 +-
 .../legacy/linear/SingularValueDecomposition.java  |  29 ++-
 .../math4/legacy/linear/SparseFieldVector.java     |   2 +-
 .../apache/commons/math4/legacy/linear/SymmLQ.java |   7 +-
 .../ml/clustering/KMeansPlusPlusClusterer.java     |   8 +-
 .../ml/clustering/MiniBatchKMeansClusterer.java    |   2 +-
 .../ml/clustering/evaluation/CalinskiHarabasz.java |   2 +-
 .../math4/legacy/ode/ContinuousOutputModel.java    |   2 +-
 .../legacy/ode/FirstOrderFieldIntegrator.java      |   2 +-
 .../math4/legacy/ode/MultistepFieldIntegrator.java |   6 +-
 .../math4/legacy/ode/MultistepIntegrator.java      |  12 +-
 .../math4/legacy/ode/SecondOrderIntegrator.java    |   2 +-
 .../legacy/ode/nonstiff/AdamsFieldIntegrator.java  |   6 +-
 .../math4/legacy/ode/nonstiff/AdamsIntegrator.java |   2 +-
 .../nonstiff/AdamsNordsieckFieldTransformer.java   |   2 +-
 .../ode/nonstiff/AdamsNordsieckTransformer.java    |   2 +-
 .../EmbeddedRungeKuttaFieldIntegrator.java         |   4 +-
 .../ode/nonstiff/GraggBulirschStoerIntegrator.java |   2 +-
 .../ode/nonstiff/HighamHall54StepInterpolator.java |   2 +-
 .../ode/nonstiff/LutherFieldStepInterpolator.java  |   4 +-
 .../ode/nonstiff/LutherStepInterpolator.java       |   2 +-
 .../ode/nonstiff/MidpointStepInterpolator.java     |   2 +-
 .../ode/nonstiff/RungeKuttaFieldIntegrator.java    |   4 +-
 .../ode/nonstiff/RungeKuttaStepInterpolator.java   |   2 +-
 .../nonstiff/ThreeEighthesStepInterpolator.java    |   2 +-
 .../ode/sampling/AbstractStepInterpolator.java     |  28 +--
 .../legacy/ode/sampling/DummyStepHandler.java      |   2 +-
 .../legacy/ode/sampling/FieldFixedStepHandler.java |   2 +-
 .../legacy/ode/sampling/FieldStepHandler.java      |   2 +-
 .../legacy/ode/sampling/FieldStepNormalizer.java   |   2 +-
 .../legacy/ode/sampling/FixedStepHandler.java      |   2 +-
 .../ode/sampling/NordsieckStepInterpolator.java    |   2 +-
 .../math4/legacy/ode/sampling/StepHandler.java     |   2 +-
 .../math4/legacy/ode/sampling/StepNormalizer.java  |   2 +-
 .../legacy/optim/AbstractOptimizationProblem.java  |   4 +-
 .../math4/legacy/optim/linear/SimplexTableau.java  |  16 +-
 .../scalar/MultiStartMultivariateOptimizer.java    |   6 +-
 .../nonlinear/scalar/noderiv/AbstractSimplex.java  |   4 +-
 .../nonlinear/scalar/noderiv/BOBYQAOptimizer.java  |  14 +-
 .../nonlinear/scalar/noderiv/CMAESOptimizer.java   |  23 +-
 .../legacy/random/HaltonSequenceGenerator.java     |   3 +-
 .../commons/math4/legacy/random/RandomUtils.java   |   9 +-
 .../legacy/random/SobolSequenceGenerator.java      |   5 +-
 .../math4/legacy/random/StableRandomGenerator.java |   6 +-
 .../commons/math4/legacy/special/BesselJ.java      |  24 +-
 .../commons/math4/legacy/stat/Frequency.java       |   8 +-
 .../commons/math4/legacy/stat/StatUtils.java       |  22 +-
 .../math4/legacy/stat/correlation/Covariance.java  |  10 +-
 .../stat/correlation/KendallsCorrelation.java      |   4 +-
 .../stat/correlation/PearsonsCorrelation.java      |   8 +-
 .../stat/correlation/SpearmansCorrelation.java     |   8 +-
 .../correlation/StorelessBivariateCovariance.java  |  10 +-
 .../stat/correlation/StorelessCovariance.java      |   8 +-
 .../AbstractStorelessUnivariateStatistic.java      |   2 +-
 .../descriptive/AbstractUnivariateStatistic.java   |   2 +-
 .../descriptive/AggregateSummaryStatistics.java    |  12 +-
 .../stat/descriptive/DescriptiveStatistics.java    |  16 +-
 .../math4/legacy/stat/descriptive/DoubleArray.java |   6 +-
 .../descriptive/MultivariateSummaryStatistics.java |  46 ++--
 .../stat/descriptive/ResizableDoubleArray.java     |  34 +--
 .../StatisticalMultivariateSummary.java            |  20 +-
 .../stat/descriptive/StatisticalSummary.java       |   8 +-
 .../stat/descriptive/StatisticalSummaryValues.java |  18 +-
 .../descriptive/StorelessUnivariateStatistic.java  |   2 +-
 .../legacy/stat/descriptive/SummaryStatistics.java |  50 ++---
 .../SynchronizedDescriptiveStatistics.java         |   6 +-
 .../SynchronizedMultivariateSummaryStatistics.java |   4 +-
 .../descriptive/SynchronizedSummaryStatistics.java |   4 +-
 .../stat/descriptive/moment/FirstMoment.java       |  10 +-
 .../stat/descriptive/moment/FourthMoment.java      |   6 +-
 .../stat/descriptive/moment/GeometricMean.java     |   6 +-
 .../legacy/stat/descriptive/moment/Kurtosis.java   |   4 +-
 .../math4/legacy/stat/descriptive/moment/Mean.java |   2 +-
 .../stat/descriptive/moment/SecondMoment.java      |   4 +-
 .../stat/descriptive/moment/SemiVariance.java      |  14 +-
 .../legacy/stat/descriptive/moment/Skewness.java   |   4 +-
 .../stat/descriptive/moment/StandardDeviation.java |   4 +-
 .../stat/descriptive/moment/ThirdMoment.java       |   4 +-
 .../legacy/stat/descriptive/moment/Variance.java   |   4 +-
 .../descriptive/moment/VectorialCovariance.java    |   4 +-
 .../stat/descriptive/moment/VectorialMean.java     |   2 +-
 .../descriptive/rank/CentralPivotingStrategy.java  |   3 +-
 .../legacy/stat/descriptive/rank/KthSelector.java  |   6 +-
 .../math4/legacy/stat/descriptive/rank/Max.java    |   6 +-
 .../math4/legacy/stat/descriptive/rank/Median.java |   4 +-
 .../rank/MedianOf3PivotingStrategy.java            |   4 +-
 .../math4/legacy/stat/descriptive/rank/Min.java    |   6 +-
 .../stat/descriptive/rank/PSquarePercentile.java   |  79 ++++---
 .../legacy/stat/descriptive/rank/Percentile.java   |  54 ++---
 .../stat/descriptive/rank/PivotingStrategy.java    |   2 +-
 .../descriptive/rank/RandomPivotingStrategy.java   |   3 +-
 .../legacy/stat/descriptive/summary/Product.java   |   4 +-
 .../math4/legacy/stat/descriptive/summary/Sum.java |   2 +-
 .../legacy/stat/descriptive/summary/SumOfLogs.java |   6 +-
 .../stat/descriptive/summary/SumOfSquares.java     |   6 +-
 .../math4/legacy/stat/inference/ChiSquareTest.java |   2 +-
 .../commons/math4/legacy/stat/inference/GTest.java |  16 +-
 .../legacy/stat/inference/InferenceTestUtils.java  |   4 +-
 .../stat/inference/KolmogorovSmirnovTest.java      |  76 ++++---
 .../legacy/stat/inference/MannWhitneyUTest.java    |  20 +-
 .../math4/legacy/stat/inference/OneWayAnova.java   |  24 +-
 .../stat/inference/WilcoxonSignedRankTest.java     |  54 ++---
 .../legacy/stat/interval/ConfidenceInterval.java   |   6 +-
 .../math4/legacy/stat/ranking/NaNStrategy.java     |  10 +-
 .../math4/legacy/stat/ranking/NaturalRanking.java  |  18 +-
 .../math4/legacy/stat/ranking/TiesStrategy.java    |  10 +-
 .../regression/GLSMultipleLinearRegression.java    |  30 +--
 .../stat/regression/MillerUpdatingRegression.java  | 242 ++++++++++-----------
 .../regression/OLSMultipleLinearRegression.java    |  16 +-
 .../legacy/stat/regression/RegressionResults.java  |  30 +--
 .../legacy/stat/regression/SimpleRegression.java   |  50 ++---
 .../UpdatingMultipleLinearRegression.java          |   4 +-
 .../math4/legacy/util/CombinatoricsUtils.java      |   4 +-
 .../commons/math4/legacy/util/CompositeFormat.java |   2 +-
 .../apache/commons/math4/legacy/PerfTestUtils.java |   7 +-
 .../org/apache/commons/math4/legacy/Retry.java     |   5 +-
 .../commons/math4/legacy/RetryRunnerTest.java      |   2 +-
 .../org/apache/commons/math4/legacy/TestUtils.java |   8 +-
 .../math4/legacy/analysis/FunctionUtilsTest.java   |   1 -
 .../differentiation/DerivativeStructureTest.java   |   6 +-
 .../differentiation/JacobianFunctionTest.java      |   2 +-
 .../differentiation/SparseGradientTest.java        |   6 +-
 .../math4/legacy/analysis/function/LogitTest.java  |   2 +-
 .../IterativeLegendreGaussIntegratorTest.java      |  13 +-
 .../integration/RombergIntegratorTest.java         |  12 +-
 .../integration/SimpsonIntegratorTest.java         |  54 +++--
 .../integration/TrapezoidIntegratorTest.java       |  12 +-
 .../gauss/GaussianQuadratureAbstractTest.java      |   2 +-
 .../interpolation/AkimaSplineInterpolatorTest.java | 129 +++++------
 .../BicubicInterpolatingFunctionTest.java          |   6 +-
 .../interpolation/BicubicInterpolatorTest.java     |   5 +-
 .../DividedDifferenceInterpolatorTest.java         |  20 +-
 .../FieldHermiteInterpolatorTest.java              |   4 +-
 .../interpolation/HermiteInterpolatorTest.java     |   4 +-
 .../interpolation/LinearInterpolatorTest.java      |  14 +-
 .../MicrosphereProjectionInterpolatorTest.java     |   4 +-
 .../interpolation/NevilleInterpolatorTest.java     |  20 +-
 .../PiecewiseBicubicSplineInterpolatorTest.java    |   6 +-
 .../interpolation/SplineInterpolatorTest.java      |  13 +-
 .../interpolation/TricubicInterpolatorTest.java    |  14 +-
 .../PolynomialFunctionLagrangeFormTest.java        |  18 +-
 .../PolynomialFunctionNewtonFormTest.java          |  18 +-
 .../analysis/polynomials/PolynomialsUtilsTest.java |  34 +--
 .../solvers/BracketingNthOrderBrentSolverTest.java |   6 +-
 .../FieldBracketingNthOrderBrentSolverTest.java    |  11 +-
 .../analysis/solvers/LaguerreSolverTest.java       |  18 +-
 .../legacy/analysis/solvers/MullerSolver2Test.java |  18 +-
 .../legacy/analysis/solvers/MullerSolverTest.java  |  18 +-
 .../legacy/analysis/solvers/RiddersSolverTest.java |  18 +-
 .../AbstractIntegerDistributionTest.java           |   5 +-
 .../distribution/EmpiricalDistributionTest.java    |   4 +-
 .../EnumeratedIntegerDistributionTest.java         |   1 -
 ...teNormalMixtureExpectationMaximizationTest.java |  20 +-
 .../field/ExtendedFieldElementAbstractTest.java    |  16 +-
 .../field/linalg/FP64FieldDenseMatrixTest.java     |   4 +-
 .../math4/legacy/filter/KalmanFilterTest.java      |  23 +-
 .../legacy/fitting/PolynomialCurveFitterTest.java  |  12 +-
 .../AbstractLeastSquaresOptimizerAbstractTest.java |   4 +-
 .../fitting/leastsquares/BevingtonProblem.java     |   2 +-
 .../legacy/fitting/leastsquares/CircleProblem.java |  10 +-
 .../fitting/leastsquares/CircleVectorial.java      |   2 +-
 ...atorVectorMultivariateJacobianFunctionTest.java |   3 +-
 .../fitting/leastsquares/EvaluationTest.java       |  23 +-
 .../leastsquares/EvaluationTestValidation.java     |  23 +-
 .../legacy/fitting/leastsquares/MinpackTest.java   | 118 +++++-----
 .../leastsquares/RandomCirclePointGenerator.java   |   1 -
 .../leastsquares/StatisticalReferenceDataset.java  |   6 +-
 .../StatisticalReferenceDatasetFactory.java        |   2 +-
 .../fitting/leastsquares/StraightLineProblem.java  |  10 +-
 .../math4/legacy/genetics/ChromosomeTest.java      |   2 +-
 .../genetics/ElitisticListPopulationTest.java      |   2 +-
 .../math4/legacy/genetics/FitnessCachingTest.java  |   2 +-
 .../genetics/GeneticAlgorithmTestBinary.java       |   2 +-
 .../genetics/GeneticAlgorithmTestPermutations.java |   2 +-
 .../legacy/genetics/TournamentSelectionTest.java   |   2 +-
 .../math4/legacy/linear/BigRealFieldTest.java      |   2 -
 .../commons/math4/legacy/linear/BigRealTest.java   |   7 +-
 .../math4/legacy/linear/BlockFieldMatrixTest.java  |  10 +-
 .../math4/legacy/linear/BlockRealMatrixTest.java   |   6 +-
 .../math4/legacy/linear/ConjugateGradientTest.java |   3 +-
 .../apache/commons/math4/legacy/linear/Dfp25.java  |   5 +-
 .../legacy/linear/EigenDecompositionTest.java      |  26 +--
 .../math4/legacy/linear/EigenSolverTest.java       |   6 +-
 .../math4/legacy/linear/FieldMatrixImplTest.java   |   4 +-
 .../legacy/linear/HessenbergTransformerTest.java   |   2 +-
 .../math4/legacy/linear/MatrixUtilsTest.java       |   4 +-
 .../legacy/linear/OpenIntToDoubleHashMapTest.java  |   1 -
 .../math4/legacy/linear/OpenIntToFieldTest.java    |   6 +-
 .../math4/legacy/linear/QRDecompositionTest.java   |  10 +-
 .../commons/math4/legacy/linear/QRSolverTest.java  |  12 +-
 .../math4/legacy/linear/RRQRDecompositionTest.java |  10 +-
 .../math4/legacy/linear/RRQRSolverTest.java        |  12 +-
 .../linear/RealMatrixFormatAbstractTest.java       |   4 +-
 .../linear/RealVectorFormatAbstractTest.java       |   4 +-
 .../math4/legacy/linear/RealVectorTest.java        |   2 +-
 .../linear/SingularValueDecompositionTest.java     |   4 +-
 .../math4/legacy/linear/SparseFieldMatrixTest.java |   6 +-
 .../math4/legacy/linear/SparseRealMatrixTest.java  |   4 +-
 .../commons/math4/legacy/linear/SymmLQTest.java    |   3 +-
 .../linear/UnmodifiableArrayRealVectorTest.java    |   6 +-
 .../linear/UnmodifiableRealVectorAbstractTest.java |  20 +-
 .../ml/clustering/KMeansPlusPlusClustererTest.java |   4 +-
 .../clustering/MiniBatchKMeansClustererTest.java   |   4 +-
 .../evaluation/CalinskiHarabaszTest.java           |   6 +-
 .../legacy/ml/distance/CanberraDistanceTest.java   |   2 +-
 .../legacy/ml/distance/ChebyshevDistanceTest.java  |   2 +-
 .../ml/distance/EarthMoversDistanceTest.java       |   6 +-
 .../legacy/ml/distance/EuclideanDistanceTest.java  |   2 +-
 .../legacy/ml/distance/ManhattanDistanceTest.java  |   2 +-
 .../legacy/ode/ContinuousOutputFieldModelTest.java |   2 +-
 .../legacy/ode/ContinuousOutputModelTest.java      |  51 +++--
 .../math4/legacy/ode/FieldExpandableODETest.java   |   2 +-
 .../math4/legacy/ode/FirstOrderConverterTest.java  |   2 +-
 .../math4/legacy/ode/JacobianMatricesTest.java     |   8 +-
 .../math4/legacy/ode/TestFieldProblem3.java        |   2 +-
 .../math4/legacy/ode/TestFieldProblem4.java        |   9 +-
 .../math4/legacy/ode/TestFieldProblemAbstract.java |   4 +-
 .../commons/math4/legacy/ode/TestProblem3.java     |   2 +-
 .../commons/math4/legacy/ode/TestProblem4.java     |   4 +-
 .../math4/legacy/ode/TestProblemAbstract.java      |   5 +-
 .../math4/legacy/ode/events/CloseEventsTest.java   |   2 +-
 .../math4/legacy/ode/events/EventFilterTest.java   |   2 +-
 .../math4/legacy/ode/events/EventStateTest.java    |  15 +-
 .../legacy/ode/events/OverlappingEventsTest.java   |   2 +-
 ...tractEmbeddedRungeKuttaFieldIntegratorTest.java |  12 +-
 .../AbstractRungeKuttaFieldIntegratorTest.java     |   4 +-
 .../ode/nonstiff/AdamsBashforthIntegratorTest.java |   4 +-
 .../nonstiff/AdamsFieldIntegratorAbstractTest.java |  12 +-
 .../ode/nonstiff/AdamsMoultonIntegratorTest.java   |   4 +-
 .../ClassicalRungeKuttaIntegratorTest.java         |   2 +-
 .../ClassicalRungeKuttaStepInterpolatorTest.java   |   2 +-
 .../math4/legacy/ode/nonstiff/Decimal64Field.java  |   2 +-
 .../math4/legacy/ode/nonstiff/Decimal64Test.java   |  19 +-
 .../nonstiff/DormandPrince54IntegratorTest.java    |   6 +-
 .../DormandPrince54StepInterpolatorTest.java       |   2 +-
 .../nonstiff/DormandPrince853IntegratorTest.java   |  10 +-
 .../DormandPrince853StepInterpolatorTest.java      |   2 +-
 ...eddedRungeKuttaFieldIntegratorAbstractTest.java |  10 +-
 .../ode/nonstiff/EulerStepInterpolatorTest.java    |   2 +-
 .../legacy/ode/nonstiff/GillIntegratorTest.java    |   2 +-
 .../ode/nonstiff/GillStepInterpolatorTest.java     |   2 +-
 .../nonstiff/GraggBulirschStoerIntegratorTest.java |   2 +-
 .../GraggBulirschStoerStepInterpolatorTest.java    |   2 +-
 .../nonstiff/HighamHall54StepInterpolatorTest.java |   2 +-
 .../legacy/ode/nonstiff/LutherIntegratorTest.java  |   2 +-
 .../ode/nonstiff/LutherStepInterpolatorTest.java   |   2 +-
 .../ode/nonstiff/MidpointStepInterpolatorTest.java |   2 +-
 .../RungeKuttaFieldIntegratorAbstractTest.java     |   2 +-
 ...ungeKuttaFieldStepInterpolatorAbstractTest.java |   2 +-
 .../ode/nonstiff/ThreeEighthesIntegratorTest.java  |   2 +-
 .../ThreeEighthesStepInterpolatorTest.java         |   2 +-
 .../ode/sampling/DummyStepInterpolatorTest.java    |   2 +-
 .../sampling/NordsieckStepInterpolatorTest.java    |   2 +-
 .../ode/sampling/StepInterpolatorTestUtils.java    |   5 +-
 .../legacy/ode/sampling/StepNormalizerTest.java    |   6 +-
 .../legacy/optim/linear/SimplexSolverTest.java     |   6 +-
 .../MultiStartMultivariateOptimizerTest.java       |   2 +-
 .../MultivariateFunctionMappingAdapterTest.java    |   6 +-
 .../MultivariateFunctionPenaltyAdapterTest.java    |   6 +-
 .../NonLinearConjugateGradientOptimizerTest.java   |   8 +-
 .../scalar/noderiv/CMAESOptimizerTest.java         |  32 +--
 .../nonlinear/scalar/noderiv/OptimTestUtils.java   |  48 ++--
 .../SimplexOptimizerMultiDirectionalTest.java      |   1 -
 .../legacy/optim/univariate/BracketFinderTest.java |   8 +-
 .../MultiStartUnivariateOptimizerTest.java         |   6 +-
 .../legacy/random/CorrelatedVectorFactoryTest.java |   2 -
 .../legacy/random/StableRandomGeneratorTest.java   |   2 +-
 .../commons/math4/legacy/stat/FrequencyTest.java   |  18 +-
 .../AggregateSummaryStatisticsTest.java            |   2 +-
 .../descriptive/DescriptiveStatisticsTest.java     |  51 +++--
 .../stat/descriptive/DoubleArrayAbstractTest.java  |   1 -
 .../MultivariateSummaryStatisticsTest.java         |   8 +-
 .../descriptive/StatisticalSummaryValuesTest.java  |   2 +-
 .../SynchronizedDescriptiveStatisticsTest.java     |  24 +-
 ...chronizedMultivariateSummaryStatisticsTest.java |  24 +-
 .../SynchronizedSummaryStatisticsTest.java         |  23 +-
 .../UnivariateStatisticAbstractTest.java           |   2 +-
 .../moment/VectorialCovarianceTest.java            |  32 +--
 .../stat/descriptive/moment/VectorialMeanTest.java |  32 +--
 .../stat/descriptive/rank/KthSelectorTest.java     |   7 +-
 .../descriptive/rank/PSquarePercentileTest.java    |  20 +-
 .../stat/descriptive/rank/PercentileTest.java      |  29 ++-
 .../legacy/stat/inference/ChiSquareTestTest.java   |   9 +-
 .../stat/inference/KolmogorovSmirnovTestTest.java  |   5 +-
 .../math4/legacy/stat/inference/TTestTest.java     |   2 +-
 .../legacy/stat/ranking/NaturalRankingTest.java    |  24 +-
 .../GLSMultipleLinearRegressionTest.java           |   4 +-
 .../regression/MillerUpdatingRegressionTest.java   |  10 +-
 .../OLSMultipleLinearRegressionTest.java           |   8 +-
 .../math4/legacy/util/CombinatoricsUtilsTest.java  |   6 +-
 .../legacy/util/ComplexFormatAbstractTest.java     |  23 +-
 .../resources/checkstyle/checkstyle-legacy.xml     |  32 +--
 .../checkstyle/checkstyle-suppressions-legacy.xml  |  40 +++-
 370 files changed, 1950 insertions(+), 1830 deletions(-)

[commons-math] 01/02: MATH-1576: Reinstate checkstyle to legacy module

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit f8741d3ab644b940ce309bc2f68796ff415886d5
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Jun 25 12:33:59 2021 +0100

    MATH-1576: Reinstate checkstyle to legacy module
    
    A simplified checkstyle configuration has been used. Additional modules
    should be added back incrementally as the codebase is corrected.
    
    Removed trailing whitespace.
    Removed tab characters.
    Fixed the correct licence header.
---
 .../org/apache/commons/math4/legacy/TestUtils.java |   4 +-
 .../integration/SimpsonIntegratorTest.java         |   2 +-
 ...teNormalMixtureExpectationMaximizationTest.java |  20 +--
 .../field/linalg/FP64FieldDenseMatrixTest.java     |   4 +-
 .../math4/legacy/filter/KalmanFilterTest.java      |  23 +--
 .../fitting/leastsquares/EvaluationTest.java       |  23 +--
 .../leastsquares/EvaluationTestValidation.java     |  23 +--
 .../legacy/linear/HessenbergTransformerTest.java   |   2 +-
 .../linear/UnmodifiableArrayRealVectorTest.java    |   6 +-
 .../linear/UnmodifiableRealVectorAbstractTest.java |  20 +--
 ...tractEmbeddedRungeKuttaFieldIntegratorTest.java |   2 +-
 .../AbstractRungeKuttaFieldIntegratorTest.java     |   2 +-
 .../nonlinear/scalar/noderiv/OptimTestUtils.java   |  12 +-
 .../descriptive/DescriptiveStatisticsTest.java     |  23 +--
 .../SynchronizedDescriptiveStatisticsTest.java     |  24 +--
 ...chronizedMultivariateSummaryStatisticsTest.java |  24 +--
 .../SynchronizedSummaryStatisticsTest.java         |  23 +--
 .../UnivariateStatisticAbstractTest.java           |   2 +-
 .../moment/VectorialCovarianceTest.java            |  32 ++--
 .../stat/descriptive/moment/VectorialMeanTest.java |  32 ++--
 .../stat/descriptive/rank/KthSelectorTest.java     |   6 +-
 .../resources/checkstyle/checkstyle-legacy.xml     | 173 +--------------------
 .../checkstyle/checkstyle-suppressions-legacy.xml  |  18 ++-
 23 files changed, 180 insertions(+), 320 deletions(-)

diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
index 6465482..5a498c8 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
@@ -362,7 +362,7 @@ public class TestUtils {
             Assert.fail(out.toString());
         }
     }
-    
+
     /** verifies that two arrays are close (sup norm) */
     public static void assertEquals(String msg, float[] expected, float[] observed, float tolerance) {
         StringBuilder out = new StringBuilder(msg);
@@ -391,7 +391,7 @@ public class TestUtils {
             Assert.fail(out.toString());
         }
     }
-   
+
     /** verifies that two arrays are close (sup norm) */
     public static void assertEquals(String msg, Complex[] expected, Complex[] observed, double tolerance) {
         StringBuilder out = new StringBuilder(msg);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
index 0284ea0..01434e5 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
@@ -155,7 +155,7 @@ public final class SimpsonIntegratorTest {
      */
     @Test
     public void testConvergenceIsPossibleAtIteration1() {
-    	// A linear function y=x should converge immediately
+        // A linear function y=x should converge immediately
         UnivariateFunction f = new Identity();
         UnivariateIntegrator integrator = new SimpsonIntegrator(1, SIMPSON_MAX_ITERATIONS_COUNT);
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
index d8e7291..56ce855 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.distribution.fitting;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/linalg/FP64FieldDenseMatrixTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/linalg/FP64FieldDenseMatrixTest.java
index 4df3fa4..1af30fa 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/linalg/FP64FieldDenseMatrixTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/linalg/FP64FieldDenseMatrixTest.java
@@ -173,7 +173,7 @@ public class FP64FieldDenseMatrixTest {
         final FieldDenseMatrix<FP64> c = FieldDenseMatrix.create(FP64Field.get(), 6, 2);
         Assert.assertNotEquals(a, c);
 
-        // Contents.        
+        // Contents.
         final FieldDenseMatrix<FP64> d = FieldDenseMatrix.create(FP64Field.get(), 7, 2);
         Assert.assertEquals(a, d); // Unitialized contents.
         a.fill(FP64.of(1.23456789));
@@ -245,7 +245,7 @@ public class FP64FieldDenseMatrixTest {
                               double tol) {
         if (a.getRowDimension() != b.getRowDimension() ||
             a.getColumnDimension() != b.getColumnDimension()) {
-            Assert.fail("Dimension mismatch"); 
+            Assert.fail("Dimension mismatch");
         }
 
         for (int i = 0; i < a.getRowDimension(); i++) {
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/filter/KalmanFilterTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/filter/KalmanFilterTest.java
index ae3c592..9319e12 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/filter/KalmanFilterTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/filter/KalmanFilterTest.java
@@ -1,15 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.commons.math4.legacy.filter;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTest.java
index e319785..71fbe50 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTest.java
@@ -1,15 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.fitting.leastsquares;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTestValidation.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTestValidation.java
index 84e0588..641962b 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTestValidation.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/EvaluationTestValidation.java
@@ -1,15 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.fitting.leastsquares;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/HessenbergTransformerTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/HessenbergTransformerTest.java
index 8dbccd5..295c59b 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/HessenbergTransformerTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/HessenbergTransformerTest.java
@@ -110,7 +110,7 @@ public class HessenbergTransformerTest {
     public void testRandomDataNormalDistribution() {
         for (int run = 0; run < 100; run++) {
             Random r = new Random(System.currentTimeMillis());
-            ContinuousDistribution.Sampler dist 
+            ContinuousDistribution.Sampler dist
                 = new NormalDistribution(0.0, r.nextDouble() * 5).createSampler(RandomSource.create(RandomSource.WELL_512_A,
                                                                                                     64925784252L));
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableArrayRealVectorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableArrayRealVectorTest.java
index e1336e0..d96e168 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableArrayRealVectorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableArrayRealVectorTest.java
@@ -1,12 +1,12 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableRealVectorAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableRealVectorAbstractTest.java
index b789c47..7bbfaba 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableRealVectorAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/UnmodifiableRealVectorAbstractTest.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.linear;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
index e735895..e411e9d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
@@ -509,7 +509,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
         }
 
         // check derivatives
-        final double[][] derivatives = sinCos.getDerivatives(t.getReal()); 
+        final double[][] derivatives = sinCos.getDerivatives(t.getReal());
         for (int i = 0; i < sinCos.getDimension(); ++i) {
             for (int parameter = 0; parameter < parameters; ++parameter) {
                 Assert.assertEquals(derivatives[i][parameter], dYdP(result.getState()[i], parameter), epsilonPartials[parameter]);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
index f2a408a..eb1fac3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
@@ -573,7 +573,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
         }
 
         // check derivatives
-        final double[][] derivatives = sinCos.getDerivatives(t.getReal()); 
+        final double[][] derivatives = sinCos.getDerivatives(t.getReal());
         for (int i = 0; i < sinCos.getDimension(); ++i) {
             for (int parameter = 0; parameter < parameters; ++parameter) {
                 Assert.assertEquals(derivatives[i][parameter],
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/OptimTestUtils.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/OptimTestUtils.java
index ae81da5..5e08280 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/OptimTestUtils.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/OptimTestUtils.java
@@ -192,14 +192,14 @@ class OptimTestUtils {
         }
     }
 
-    static class SsDiffPow implements MultivariateFunction { 
+    static class SsDiffPow implements MultivariateFunction {
         @Override
         public double value(double[] x) {
             double f = AccurateMath.pow(new DiffPow().value(x), 0.25);
             return f;
         }
     }
- 
+
     static class Rosen implements MultivariateFunction {
         @Override
         public double value(double[] x) {
@@ -212,7 +212,7 @@ class OptimTestUtils {
             return f;
         }
     }
- 
+
     static class Ackley implements MultivariateFunction {
         private static final double A = 20;
         private static final double B = 0.2;
@@ -235,19 +235,19 @@ class OptimTestUtils {
         }
     }
 
-    static class Rastrigin implements MultivariateFunction { 
+    static class Rastrigin implements MultivariateFunction {
         private double axisratio;
         private double amplitude;
 
         Rastrigin() {
             this(1, 10);
         }
-     
+
         Rastrigin(double axisratio, double amplitude) {
             this.axisratio = axisratio;
             this.amplitude = amplitude;
         }
-     
+
         @Override
         public double value(double[] x) {
             double f = 0;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatisticsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatisticsTest.java
index d742b5b..7cdb6f2 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatisticsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatisticsTest.java
@@ -1,15 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.stat.descriptive;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatisticsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatisticsTest.java
index 7a2a4eb..512063a 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatisticsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatisticsTest.java
@@ -1,19 +1,21 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.stat.descriptive;
 
-
 /**
  * Test cases for the {@link SynchronizedDescriptiveStatisticsTest} class.
  *          2007) $
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatisticsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatisticsTest.java
index 6859b0d..ce9e0e7 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatisticsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatisticsTest.java
@@ -1,19 +1,21 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.stat.descriptive;
 
-
 /**
  * Test cases for the {@link SynchronizedMultivariateSummaryStatisticsTest} class.
  *          2007) $
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatisticsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatisticsTest.java
index bb1828a..6f4c585 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatisticsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatisticsTest.java
@@ -1,15 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.math4.legacy.stat.descriptive;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatisticAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatisticAbstractTest.java
index 2f3e208..f9572f6 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatisticAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/UnivariateStatisticAbstractTest.java
@@ -8,7 +8,7 @@
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
-s * Unless required by applicable law or agreed to in writing, software
+ * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovarianceTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovarianceTest.java
index 484cdea..3553cf3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovarianceTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovarianceTest.java
@@ -1,19 +1,19 @@
-//Licensed to the Apache Software Foundation (ASF) under one
-//or more contributor license agreements.  See the NOTICE file
-//distributed with this work for additional information
-//regarding copyright ownership.  The ASF licenses this file
-//to you under the Apache License, Version 2.0 (the
-//"License"); you may not use this file except in compliance
-//with the License.  You may obtain a copy of the License at
-
-//http://www.apache.org/licenses/LICENSE-2.0
-
-//Unless required by applicable law or agreed to in writing,
-//software distributed under the License is distributed on an
-//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-//KIND, either express or implied.  See the License for the
-//specific language governing permissions and limitations
-//under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package org.apache.commons.math4.legacy.stat.descriptive.moment;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMeanTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMeanTest.java
index f765240..aa60383 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMeanTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMeanTest.java
@@ -1,19 +1,19 @@
-//Licensed to the Apache Software Foundation (ASF) under one
-//or more contributor license agreements.  See the NOTICE file
-//distributed with this work for additional information
-//regarding copyright ownership.  The ASF licenses this file
-//to you under the Apache License, Version 2.0 (the
-//"License"); you may not use this file except in compliance
-//with the License.  You may obtain a copy of the License at
-
-//http://www.apache.org/licenses/LICENSE-2.0
-
-//Unless required by applicable law or agreed to in writing,
-//software distributed under the License is distributed on an
-//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-//KIND, either express or implied.  See the License for the
-//specific language governing permissions and limitations
-//under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package org.apache.commons.math4.legacy.stat.descriptive.moment;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java
index aee80ed..8e88e63 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelectorTest.java
@@ -28,12 +28,12 @@ public class KthSelectorTest {
 
     @Test
     public void testRandom() {
-        
+
         final int numIterations = 100000;
         final double[] possibleValues = {Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.MAX_VALUE, Double.MIN_VALUE, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -0., 0., 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
         final Random rnd = new Random(0);
         for (int i = 0; i < numIterations; ++i) {
-            
+
             final int dataSize = rnd.nextInt(30);
 
             final double[] data = new double[dataSize];
@@ -41,7 +41,7 @@ public class KthSelectorTest {
             for (int j = 0; j < dataSize; ++j) {
                 data[j] = possibleValues[rnd.nextInt(possibleValues.length)];
             }
-            
+
             final double[] dataSorted = Arrays.copyOf(data, data.length);
             Arrays.sort(dataSorted);
 
diff --git a/src/main/resources/checkstyle/checkstyle-legacy.xml b/src/main/resources/checkstyle/checkstyle-legacy.xml
index 23d566a..8752e0e 100644
--- a/src/main/resources/checkstyle/checkstyle-legacy.xml
+++ b/src/main/resources/checkstyle/checkstyle-legacy.xml
@@ -81,180 +81,11 @@
   <!-- See http://checkstyle.sourceforge.net/config_header.html -->
   <module name="Header">
     <property name="headerFile" value="${checkstyle.header.file}"/>
+    <property name="fileExtensions" value="java"/>
   </module>
 
   <module name="TreeWalker">
-
-    <!-- Checks for Javadoc comments. -->
-    <!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
-    <module name="InvalidJavadocPosition"/>
-    <module name="JavadocMethod" />
-    <module name="JavadocType" />
-    <module name="JavadocVariable" />
-    <module name="JavadocStyle" />
-    <!-- <module name="MissingJavadocType"/> -->
-
-    <!-- Checks for Naming Conventions. -->
-    <!-- See http://checkstyle.sourceforge.net/config_naming.html -->
-    <module name="ConstantName" />
-    <module name="LocalFinalVariableName" />
-    <module name="LocalVariableName" />
-    <module name="MemberName" />
-    <module name="MethodName" />
-    <module name="PackageName" />
-    <module name="ParameterName" />
-    <module name="StaticVariableName" />
-    <module name="TypeName" />
-
-    <!-- Checks for imports -->
-    <!-- See http://checkstyle.sourceforge.net/config_import.html -->
-    <module name="AvoidStarImport" />
-    <module name="IllegalImport" /> <!-- defaults to sun.* packages -->
-    <module name="RedundantImport" />
-    <module name="UnusedImports">
-      <property name="processJavadoc" value="false" />
-    </module>
-
-    <!-- Checks for Size Violations. -->
-    <!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
-    <module name="MethodLength" />
-    <module name="ParameterNumber" />
-
-    <!-- Checks for whitespace -->
-    <!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
-    <module name="EmptyForIteratorPad" />
-    <module name="GenericWhitespace" />
-    <module name="MethodParamPad" />
-    <module name="NoWhitespaceAfter" />
-    <module name="NoWhitespaceBefore" />
-    <!-- Operator must be at end of wrapped line -->
-    <module name="OperatorWrap">
-      <property name="option" value="eol"/>
-    </module>
-    <module name="ParenPad" />
-    <module name="TypecastParenPad" />
-    <module name="WhitespaceAfter">
-      <property name="tokens" value="COMMA, SEMI, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
-    </module>
-    <module name="WhitespaceAround">
-      <property name="allowEmptyConstructors" value="true"/>
-      <property name="allowEmptyTypes" value="true"/>
-    </module>
-
-    <!-- Modifier Checks -->
-    <!-- See http://checkstyle.sourceforge.net/config_modifiers.html -->
-    <module name="ModifierOrder" />
-    <module name="RedundantModifier" />
-
-    <!-- Checks for blocks. You know, those {}'s -->
-    <!-- See http://checkstyle.sourceforge.net/config_blocks.html -->
-    <module name="AvoidNestedBlocks" />
-    <module name="EmptyBlock" />
-    <module name="LeftCurly" />
-    <module name="NeedBraces" />
-    <module name="RightCurly" />
-
-    <!-- Checks for common coding problems -->
-    <!-- See http://checkstyle.sourceforge.net/config_coding.html -->
-    <module name="EmptyStatement" />
-    <module name="EqualsHashCode" />
-    <!-- Method parameters and local variables should not hide fields, except in constructors and setters -->
-    <module name="HiddenField">
-        <property name="ignoreConstructorParameter" value="true" />
-        <property name="ignoreSetter" value="true" />
-    </module>
-    <!-- Disallow unnecessary instantiation of Boolean, String -->
-    <module name="IllegalInstantiation">
-      <property name="classes" value="java.lang.Boolean, java.lang.String"/>
-    </module>
-    <!-- Allowed for algorithm implementations. -->
-    <!-- <module name="InnerAssignment" /> -->
-    <!-- <module name="MagicNumber" /> -->
-    <module name="MissingSwitchDefault" />
-    <module name="MultipleVariableDeclarations" />
-    <module name="SimplifyBooleanExpression" />
-    <module name="SimplifyBooleanReturn" />
-
-    <!-- Checks for class design -->
-    <!-- See http://checkstyle.sourceforge.net/config_design.html -->
-    <module name="DesignForExtension" />
-    <module name="FinalClass" />
-    <module name="HideUtilityClassConstructor" />
-    <module name="InterfaceIsType" />
-    <!-- No public fields -->
-    <module name="VisibilityModifier">
-       <property name="protectedAllowed" value="true"/>
-    </module>
-
-    <!-- Miscellaneous other checks. -->
-    <!-- See http://checkstyle.sourceforge.net/config_misc.html -->
-    <module name="ArrayTypeStyle" />
-    <!-- <module name="FinalParameters" />  -->
-    <module name="TodoComment">
-      <property name="severity" value="warning"/>
-    </module>
-    <module name="UpperEll" />
-
-    <!-- Addition to Checkstyle sun_checks.xml  -->
-
-    <!-- Indentation of 4 spaces. -->
-    <module name="Indentation">
-      <!-- Indentation style recommended by Oracle -->
-      <property name="caseIndent" value="0"/>
-    </module>
-
-    <!-- Switch statements should have independent cases -->
-    <module name="FallThrough" />
-
-    <!-- Constant names should obey the traditional all uppercase naming convention -->
-    <module name="ConstantName" />
-
-    <!-- No System.out.println() statements -->
-    <module name="Regexp">
-      <!-- no sysouts -->
-      <property name="format" value="System\.(out|err)\."/>
-      <property name="illegalPattern" value="true"/>
-    </module>
-
-    <!-- Authors should be in pom.xml file -->
-    <module name="Regexp">
-      <property name="format" value="@author"/>
-      <property name="illegalPattern" value="true"/>
-      <property name="message" value="Developers names should be in pom file"/>
-    </module>
-
-    <!-- Use a consistent way to put declarations -->
-    <module name="DeclarationOrder" />
-
-    <!-- Don't add up parentheses when they are not required -->
-    <module name="UnnecessaryParentheses" />
-
-    <!--  Don't use too widespread catch (Exception, Throwable, RuntimeException)  -->
-    <module name="IllegalCatch" />
-
-    <!-- Don't use = or != for string comparisons -->
-    <module name="StringLiteralEquality" />
-
-    <!-- String literals more than one character long should not be repeated several times -->
-    <!-- the "unchecked" string is also accepted to allow @SuppressWarnings("unchecked") -->
-    <module name="MultipleStringLiterals" >
-      <property name="ignoreStringsRegexp" value='^(("")|(".")|("unchecked"))$'/>
-    </module>
-
-    <!-- Check if @Override tags are present  -->
-    <module name="MissingOverride" />
-
-    <!-- Setup special comments to suppress specific checks from source files -->
-    <module name="SuppressionCommentFilter">
-      <property name="offCommentFormat" value="CHECKSTYLE\: stop ([\w\|]+)"/>
-      <property name="onCommentFormat"  value="CHECKSTYLE\: resume ([\w\|]+)"/>
-      <property name="checkFormat"      value="$1"/>
-    </module>
-    <module name="SuppressionCommentFilter">
-      <property name="offCommentFormat" value="CHECKSTYLE\: stop all"/>
-      <property name="onCommentFormat"  value="CHECKSTYLE\: resume all"/>
-    </module>
-
+    <!-- Add back modules from the checkstyle.xml used for non-legacy modules -->
   </module>
 
 </module>
diff --git a/src/main/resources/checkstyle/checkstyle-suppressions-legacy.xml b/src/main/resources/checkstyle/checkstyle-suppressions-legacy.xml
index 4765444..45367f7 100644
--- a/src/main/resources/checkstyle/checkstyle-suppressions-legacy.xml
+++ b/src/main/resources/checkstyle/checkstyle-suppressions-legacy.xml
@@ -19,8 +19,18 @@
     "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
     "https://checkstyle.org/dtds/suppressions_1_2.dtd">
 <suppressions>
-  <!-- Disable all checks for main code! XXX -->
-  <suppress checks=".*" files=".*[/\\]main[/\\].*" />
-  <!-- Disable all checks for unit tests. -->
-  <suppress checks=".*" files=".*[/\\]test[/\\].*" />
+  <suppress checks="LineLength" />
+  <suppress checks="JavadocPackage" />
+
+  <suppress checks="FileLength" files=".*[/\\]BOBYQAOptimizer.java" />
+
+  <!-- Be more lenient on tests. -->
+  <suppress checks="Javadoc" files=".*[/\\]test[/\\].*" />
+  <suppress checks="MultipleStringLiterals" files=".*[/\\]test[/\\].*" />
+  <suppress checks="DesignForExtension" files=".*[/\\]test[/\\].*" />
+  <suppress checks="LineLength" files=".*[/\\]test[/\\].*" />
+  <suppress checks="FileLength" files=".*[/\\]test[/\\].*" />
+  <suppress checks="IllegalCatch" files=".*[/\\]test[/\\].*" />
+  <suppress checks="MethodName" files=".*[/\\]test[/\\].*" />
+  <suppress checks="ConstantName" files=".*[/\\]test[/\\].*" />
 </suppressions>

[commons-math] 02/02: MATH-1576: Fix checkstyle in legacy module

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit 7f425354fb4eed78832bbcb37b81acfd21879ab0
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Jun 25 13:33:19 2021 +0100

    MATH-1576: Fix checkstyle in legacy module
    
    Fix many of the modules.
    
    The remaining modules have been added back and commented out:
    
    ParameterNumber - 50 errors
    MethodParamPad - 94 errors
    NoWhitespaceAfter - 3949 errors
    NoWhitespaceBefore - 1605 errors
    OperatorWrap - 54 errors
    ParenPad - 884 errors
    WhitespaceAfter - 7543 errors
    WhitespaceAround - 2198 errors
    HiddenField - 64 errors
    ArrayTypeStyle - 197 errors
    Indentation - 7293 errors
---
 commons-math-legacy/pom.xml                        |   1 +
 .../math4/legacy/analysis/FunctionUtils.java       |  12 +-
 .../analysis/differentiation/DSCompiler.java       |   8 +-
 .../differentiation/DerivativeStructure.java       |   6 +-
 .../analysis/differentiation/SparseGradient.java   |  17 +-
 .../math4/legacy/analysis/function/Gaussian.java   |   2 +-
 .../analysis/function/HarmonicOscillator.java      |   2 +-
 .../math4/legacy/analysis/function/Logistic.java   |   2 +-
 .../math4/legacy/analysis/function/Logit.java      |   2 +-
 .../math4/legacy/analysis/function/Sigmoid.java    |   2 +-
 .../BaseAbstractUnivariateIntegrator.java          |   4 +-
 .../analysis/integration/RombergIntegrator.java    |   2 +-
 .../integration/gauss/BaseRuleFactory.java         |   2 +-
 .../integration/gauss/HermiteRuleFactory.java      |   6 +-
 .../BicubicInterpolatingFunction.java              |  18 +-
 .../interpolation/BicubicInterpolator.java         |   8 +-
 .../DividedDifferenceInterpolator.java             |   2 +-
 .../analysis/interpolation/LoessInterpolator.java  |   2 +-
 .../interpolation/NevilleInterpolator.java         |   2 +-
 ...iecewiseBicubicSplineInterpolatingFunction.java |  14 +-
 .../TricubicInterpolatingFunction.java             |  20 +-
 .../interpolation/TricubicInterpolator.java        |   8 +-
 .../analysis/polynomials/PolynomialFunction.java   |   2 +-
 .../PolynomialFunctionLagrangeForm.java            |   7 +-
 .../polynomials/PolynomialSplineFunction.java      |   8 +-
 .../analysis/polynomials/PolynomialsUtils.java     |   6 +-
 .../solvers/BracketingNthOrderBrentSolver.java     |   2 +-
 .../legacy/analysis/solvers/LaguerreSolver.java    |  12 +-
 .../analysis/solvers/UnivariateSolverUtils.java    |   2 +-
 .../legacy/distribution/EmpiricalDistribution.java |  32 +--
 .../MixtureMultivariateRealDistribution.java       |   2 +-
 .../field/linalg/FieldDecompositionSolver.java     |   2 +-
 .../legacy/field/linalg/FieldLUDecomposition.java  |   4 +-
 .../math4/legacy/fitting/GaussianCurveFitter.java  |   2 +-
 .../math4/legacy/fitting/HarmonicCurveFitter.java  |   6 +-
 .../legacy/fitting/PolynomialCurveFitter.java      |   4 +-
 .../math4/legacy/fitting/SimpleCurveFitter.java    |   5 +-
 .../fitting/leastsquares/AbstractEvaluation.java   |   2 +-
 .../leastsquares/DenseWeightedEvaluation.java      |   4 +-
 ...entiatorVectorMultivariateJacobianFunction.java |   2 +-
 .../fitting/leastsquares/GaussNewtonOptimizer.java |   2 +-
 .../fitting/leastsquares/LeastSquaresAdapter.java  |   2 +-
 .../fitting/leastsquares/LeastSquaresBuilder.java  |  14 +-
 .../fitting/leastsquares/LeastSquaresFactory.java  |   6 +-
 .../legacy/fitting/leastsquares/OptimumImpl.java   |   6 +-
 .../leastsquares/ValueAndJacobianFunction.java     |   4 +-
 .../legacy/genetics/AbstractListChromosome.java    |   4 +-
 .../legacy/genetics/ElitisticListPopulation.java   |   2 +-
 .../legacy/genetics/FixedGenerationCount.java      |   4 +-
 .../genetics/InvalidRepresentationException.java   |   2 +-
 .../math4/legacy/genetics/ListPopulation.java      |   6 +-
 .../math4/legacy/genetics/TournamentSelection.java |   2 +-
 .../math4/legacy/linear/AbstractFieldMatrix.java   |  10 +-
 .../math4/legacy/linear/AbstractRealMatrix.java    |   4 +-
 .../math4/legacy/linear/Array2DRowFieldMatrix.java |   6 +-
 .../math4/legacy/linear/Array2DRowRealMatrix.java  |   2 +-
 .../commons/math4/legacy/linear/BigReal.java       |   6 +-
 .../commons/math4/legacy/linear/BigRealField.java  |   4 +-
 .../math4/legacy/linear/BlockRealMatrix.java       |   2 +-
 .../math4/legacy/linear/CholeskyDecomposition.java |   4 +-
 .../math4/legacy/linear/DecompositionSolver.java   |   4 +-
 .../math4/legacy/linear/EigenDecomposition.java    |   6 +-
 .../legacy/linear/FieldDecompositionSolver.java    |   4 +-
 .../math4/legacy/linear/FieldLUDecomposition.java  |   2 +-
 .../commons/math4/legacy/linear/FieldMatrix.java   |   4 +-
 .../math4/legacy/linear/IterationEvent.java        |   2 -
 .../math4/legacy/linear/IterativeLinearSolver.java |   7 +-
 .../math4/legacy/linear/LUDecomposition.java       |   4 +-
 .../commons/math4/legacy/linear/MatrixUtils.java   |   6 +-
 .../legacy/linear/OpenIntToDoubleHashMap.java      |  38 ++--
 .../math4/legacy/linear/OpenIntToFieldHashMap.java |  36 +--
 .../math4/legacy/linear/OpenMapRealMatrix.java     |   2 +-
 .../PreconditionedIterativeLinearSolver.java       |  15 +-
 .../math4/legacy/linear/QRDecomposition.java       |   2 +-
 .../math4/legacy/linear/RRQRDecomposition.java     |   4 +-
 .../math4/legacy/linear/RealLinearOperator.java    |   2 +-
 .../commons/math4/legacy/linear/RealMatrix.java    |   2 +-
 .../math4/legacy/linear/SchurTransformer.java      |   8 +-
 .../legacy/linear/SingularValueDecomposition.java  |  29 ++-
 .../math4/legacy/linear/SparseFieldVector.java     |   2 +-
 .../apache/commons/math4/legacy/linear/SymmLQ.java |   7 +-
 .../ml/clustering/KMeansPlusPlusClusterer.java     |   8 +-
 .../ml/clustering/MiniBatchKMeansClusterer.java    |   2 +-
 .../ml/clustering/evaluation/CalinskiHarabasz.java |   2 +-
 .../math4/legacy/ode/ContinuousOutputModel.java    |   2 +-
 .../legacy/ode/FirstOrderFieldIntegrator.java      |   2 +-
 .../math4/legacy/ode/MultistepFieldIntegrator.java |   6 +-
 .../math4/legacy/ode/MultistepIntegrator.java      |  12 +-
 .../math4/legacy/ode/SecondOrderIntegrator.java    |   2 +-
 .../legacy/ode/nonstiff/AdamsFieldIntegrator.java  |   6 +-
 .../math4/legacy/ode/nonstiff/AdamsIntegrator.java |   2 +-
 .../nonstiff/AdamsNordsieckFieldTransformer.java   |   2 +-
 .../ode/nonstiff/AdamsNordsieckTransformer.java    |   2 +-
 .../EmbeddedRungeKuttaFieldIntegrator.java         |   4 +-
 .../ode/nonstiff/GraggBulirschStoerIntegrator.java |   2 +-
 .../ode/nonstiff/HighamHall54StepInterpolator.java |   2 +-
 .../ode/nonstiff/LutherFieldStepInterpolator.java  |   4 +-
 .../ode/nonstiff/LutherStepInterpolator.java       |   2 +-
 .../ode/nonstiff/MidpointStepInterpolator.java     |   2 +-
 .../ode/nonstiff/RungeKuttaFieldIntegrator.java    |   4 +-
 .../ode/nonstiff/RungeKuttaStepInterpolator.java   |   2 +-
 .../nonstiff/ThreeEighthesStepInterpolator.java    |   2 +-
 .../ode/sampling/AbstractStepInterpolator.java     |  28 +--
 .../legacy/ode/sampling/DummyStepHandler.java      |   2 +-
 .../legacy/ode/sampling/FieldFixedStepHandler.java |   2 +-
 .../legacy/ode/sampling/FieldStepHandler.java      |   2 +-
 .../legacy/ode/sampling/FieldStepNormalizer.java   |   2 +-
 .../legacy/ode/sampling/FixedStepHandler.java      |   2 +-
 .../ode/sampling/NordsieckStepInterpolator.java    |   2 +-
 .../math4/legacy/ode/sampling/StepHandler.java     |   2 +-
 .../math4/legacy/ode/sampling/StepNormalizer.java  |   2 +-
 .../legacy/optim/AbstractOptimizationProblem.java  |   4 +-
 .../math4/legacy/optim/linear/SimplexTableau.java  |  16 +-
 .../scalar/MultiStartMultivariateOptimizer.java    |   6 +-
 .../nonlinear/scalar/noderiv/AbstractSimplex.java  |   4 +-
 .../nonlinear/scalar/noderiv/BOBYQAOptimizer.java  |  14 +-
 .../nonlinear/scalar/noderiv/CMAESOptimizer.java   |  23 +-
 .../legacy/random/HaltonSequenceGenerator.java     |   3 +-
 .../commons/math4/legacy/random/RandomUtils.java   |   9 +-
 .../legacy/random/SobolSequenceGenerator.java      |   5 +-
 .../math4/legacy/random/StableRandomGenerator.java |   6 +-
 .../commons/math4/legacy/special/BesselJ.java      |  24 +-
 .../commons/math4/legacy/stat/Frequency.java       |   8 +-
 .../commons/math4/legacy/stat/StatUtils.java       |  22 +-
 .../math4/legacy/stat/correlation/Covariance.java  |  10 +-
 .../stat/correlation/KendallsCorrelation.java      |   4 +-
 .../stat/correlation/PearsonsCorrelation.java      |   8 +-
 .../stat/correlation/SpearmansCorrelation.java     |   8 +-
 .../correlation/StorelessBivariateCovariance.java  |  10 +-
 .../stat/correlation/StorelessCovariance.java      |   8 +-
 .../AbstractStorelessUnivariateStatistic.java      |   2 +-
 .../descriptive/AbstractUnivariateStatistic.java   |   2 +-
 .../descriptive/AggregateSummaryStatistics.java    |  12 +-
 .../stat/descriptive/DescriptiveStatistics.java    |  16 +-
 .../math4/legacy/stat/descriptive/DoubleArray.java |   6 +-
 .../descriptive/MultivariateSummaryStatistics.java |  46 ++--
 .../stat/descriptive/ResizableDoubleArray.java     |  34 +--
 .../StatisticalMultivariateSummary.java            |  20 +-
 .../stat/descriptive/StatisticalSummary.java       |   8 +-
 .../stat/descriptive/StatisticalSummaryValues.java |  18 +-
 .../descriptive/StorelessUnivariateStatistic.java  |   2 +-
 .../legacy/stat/descriptive/SummaryStatistics.java |  50 ++---
 .../SynchronizedDescriptiveStatistics.java         |   6 +-
 .../SynchronizedMultivariateSummaryStatistics.java |   4 +-
 .../descriptive/SynchronizedSummaryStatistics.java |   4 +-
 .../stat/descriptive/moment/FirstMoment.java       |  10 +-
 .../stat/descriptive/moment/FourthMoment.java      |   6 +-
 .../stat/descriptive/moment/GeometricMean.java     |   6 +-
 .../legacy/stat/descriptive/moment/Kurtosis.java   |   4 +-
 .../math4/legacy/stat/descriptive/moment/Mean.java |   2 +-
 .../stat/descriptive/moment/SecondMoment.java      |   4 +-
 .../stat/descriptive/moment/SemiVariance.java      |  14 +-
 .../legacy/stat/descriptive/moment/Skewness.java   |   4 +-
 .../stat/descriptive/moment/StandardDeviation.java |   4 +-
 .../stat/descriptive/moment/ThirdMoment.java       |   4 +-
 .../legacy/stat/descriptive/moment/Variance.java   |   4 +-
 .../descriptive/moment/VectorialCovariance.java    |   4 +-
 .../stat/descriptive/moment/VectorialMean.java     |   2 +-
 .../descriptive/rank/CentralPivotingStrategy.java  |   3 +-
 .../legacy/stat/descriptive/rank/KthSelector.java  |   6 +-
 .../math4/legacy/stat/descriptive/rank/Max.java    |   6 +-
 .../math4/legacy/stat/descriptive/rank/Median.java |   4 +-
 .../rank/MedianOf3PivotingStrategy.java            |   4 +-
 .../math4/legacy/stat/descriptive/rank/Min.java    |   6 +-
 .../stat/descriptive/rank/PSquarePercentile.java   |  79 ++++---
 .../legacy/stat/descriptive/rank/Percentile.java   |  54 ++---
 .../stat/descriptive/rank/PivotingStrategy.java    |   2 +-
 .../descriptive/rank/RandomPivotingStrategy.java   |   3 +-
 .../legacy/stat/descriptive/summary/Product.java   |   4 +-
 .../math4/legacy/stat/descriptive/summary/Sum.java |   2 +-
 .../legacy/stat/descriptive/summary/SumOfLogs.java |   6 +-
 .../stat/descriptive/summary/SumOfSquares.java     |   6 +-
 .../math4/legacy/stat/inference/ChiSquareTest.java |   2 +-
 .../commons/math4/legacy/stat/inference/GTest.java |  16 +-
 .../legacy/stat/inference/InferenceTestUtils.java  |   4 +-
 .../stat/inference/KolmogorovSmirnovTest.java      |  76 ++++---
 .../legacy/stat/inference/MannWhitneyUTest.java    |  20 +-
 .../math4/legacy/stat/inference/OneWayAnova.java   |  24 +-
 .../stat/inference/WilcoxonSignedRankTest.java     |  54 ++---
 .../legacy/stat/interval/ConfidenceInterval.java   |   6 +-
 .../math4/legacy/stat/ranking/NaNStrategy.java     |  10 +-
 .../math4/legacy/stat/ranking/NaturalRanking.java  |  18 +-
 .../math4/legacy/stat/ranking/TiesStrategy.java    |  10 +-
 .../regression/GLSMultipleLinearRegression.java    |  30 +--
 .../stat/regression/MillerUpdatingRegression.java  | 242 ++++++++++-----------
 .../regression/OLSMultipleLinearRegression.java    |  16 +-
 .../legacy/stat/regression/RegressionResults.java  |  30 +--
 .../legacy/stat/regression/SimpleRegression.java   |  50 ++---
 .../UpdatingMultipleLinearRegression.java          |   4 +-
 .../math4/legacy/util/CombinatoricsUtils.java      |   4 +-
 .../commons/math4/legacy/util/CompositeFormat.java |   2 +-
 .../apache/commons/math4/legacy/PerfTestUtils.java |   7 +-
 .../org/apache/commons/math4/legacy/Retry.java     |   5 +-
 .../commons/math4/legacy/RetryRunnerTest.java      |   2 +-
 .../org/apache/commons/math4/legacy/TestUtils.java |   4 +-
 .../math4/legacy/analysis/FunctionUtilsTest.java   |   1 -
 .../differentiation/DerivativeStructureTest.java   |   6 +-
 .../differentiation/JacobianFunctionTest.java      |   2 +-
 .../differentiation/SparseGradientTest.java        |   6 +-
 .../math4/legacy/analysis/function/LogitTest.java  |   2 +-
 .../IterativeLegendreGaussIntegratorTest.java      |  13 +-
 .../integration/RombergIntegratorTest.java         |  12 +-
 .../integration/SimpsonIntegratorTest.java         |  52 +++--
 .../integration/TrapezoidIntegratorTest.java       |  12 +-
 .../gauss/GaussianQuadratureAbstractTest.java      |   2 +-
 .../interpolation/AkimaSplineInterpolatorTest.java | 129 +++++------
 .../BicubicInterpolatingFunctionTest.java          |   6 +-
 .../interpolation/BicubicInterpolatorTest.java     |   5 +-
 .../DividedDifferenceInterpolatorTest.java         |  20 +-
 .../FieldHermiteInterpolatorTest.java              |   4 +-
 .../interpolation/HermiteInterpolatorTest.java     |   4 +-
 .../interpolation/LinearInterpolatorTest.java      |  14 +-
 .../MicrosphereProjectionInterpolatorTest.java     |   4 +-
 .../interpolation/NevilleInterpolatorTest.java     |  20 +-
 .../PiecewiseBicubicSplineInterpolatorTest.java    |   6 +-
 .../interpolation/SplineInterpolatorTest.java      |  13 +-
 .../interpolation/TricubicInterpolatorTest.java    |  14 +-
 .../PolynomialFunctionLagrangeFormTest.java        |  18 +-
 .../PolynomialFunctionNewtonFormTest.java          |  18 +-
 .../analysis/polynomials/PolynomialsUtilsTest.java |  34 +--
 .../solvers/BracketingNthOrderBrentSolverTest.java |   6 +-
 .../FieldBracketingNthOrderBrentSolverTest.java    |  11 +-
 .../analysis/solvers/LaguerreSolverTest.java       |  18 +-
 .../legacy/analysis/solvers/MullerSolver2Test.java |  18 +-
 .../legacy/analysis/solvers/MullerSolverTest.java  |  18 +-
 .../legacy/analysis/solvers/RiddersSolverTest.java |  18 +-
 .../AbstractIntegerDistributionTest.java           |   5 +-
 .../distribution/EmpiricalDistributionTest.java    |   4 +-
 .../EnumeratedIntegerDistributionTest.java         |   1 -
 .../field/ExtendedFieldElementAbstractTest.java    |  16 +-
 .../legacy/fitting/PolynomialCurveFitterTest.java  |  12 +-
 .../AbstractLeastSquaresOptimizerAbstractTest.java |   4 +-
 .../fitting/leastsquares/BevingtonProblem.java     |   2 +-
 .../legacy/fitting/leastsquares/CircleProblem.java |  10 +-
 .../fitting/leastsquares/CircleVectorial.java      |   2 +-
 ...atorVectorMultivariateJacobianFunctionTest.java |   3 +-
 .../legacy/fitting/leastsquares/MinpackTest.java   | 118 +++++-----
 .../leastsquares/RandomCirclePointGenerator.java   |   1 -
 .../leastsquares/StatisticalReferenceDataset.java  |   6 +-
 .../StatisticalReferenceDatasetFactory.java        |   2 +-
 .../fitting/leastsquares/StraightLineProblem.java  |  10 +-
 .../math4/legacy/genetics/ChromosomeTest.java      |   2 +-
 .../genetics/ElitisticListPopulationTest.java      |   2 +-
 .../math4/legacy/genetics/FitnessCachingTest.java  |   2 +-
 .../genetics/GeneticAlgorithmTestBinary.java       |   2 +-
 .../genetics/GeneticAlgorithmTestPermutations.java |   2 +-
 .../legacy/genetics/TournamentSelectionTest.java   |   2 +-
 .../math4/legacy/linear/BigRealFieldTest.java      |   2 -
 .../commons/math4/legacy/linear/BigRealTest.java   |   7 +-
 .../math4/legacy/linear/BlockFieldMatrixTest.java  |  10 +-
 .../math4/legacy/linear/BlockRealMatrixTest.java   |   6 +-
 .../math4/legacy/linear/ConjugateGradientTest.java |   3 +-
 .../apache/commons/math4/legacy/linear/Dfp25.java  |   5 +-
 .../legacy/linear/EigenDecompositionTest.java      |  26 +--
 .../math4/legacy/linear/EigenSolverTest.java       |   6 +-
 .../math4/legacy/linear/FieldMatrixImplTest.java   |   4 +-
 .../math4/legacy/linear/MatrixUtilsTest.java       |   4 +-
 .../legacy/linear/OpenIntToDoubleHashMapTest.java  |   1 -
 .../math4/legacy/linear/OpenIntToFieldTest.java    |   6 +-
 .../math4/legacy/linear/QRDecompositionTest.java   |  10 +-
 .../commons/math4/legacy/linear/QRSolverTest.java  |  12 +-
 .../math4/legacy/linear/RRQRDecompositionTest.java |  10 +-
 .../math4/legacy/linear/RRQRSolverTest.java        |  12 +-
 .../linear/RealMatrixFormatAbstractTest.java       |   4 +-
 .../linear/RealVectorFormatAbstractTest.java       |   4 +-
 .../math4/legacy/linear/RealVectorTest.java        |   2 +-
 .../linear/SingularValueDecompositionTest.java     |   4 +-
 .../math4/legacy/linear/SparseFieldMatrixTest.java |   6 +-
 .../math4/legacy/linear/SparseRealMatrixTest.java  |   4 +-
 .../commons/math4/legacy/linear/SymmLQTest.java    |   3 +-
 .../ml/clustering/KMeansPlusPlusClustererTest.java |   4 +-
 .../clustering/MiniBatchKMeansClustererTest.java   |   4 +-
 .../evaluation/CalinskiHarabaszTest.java           |   6 +-
 .../legacy/ml/distance/CanberraDistanceTest.java   |   2 +-
 .../legacy/ml/distance/ChebyshevDistanceTest.java  |   2 +-
 .../ml/distance/EarthMoversDistanceTest.java       |   6 +-
 .../legacy/ml/distance/EuclideanDistanceTest.java  |   2 +-
 .../legacy/ml/distance/ManhattanDistanceTest.java  |   2 +-
 .../legacy/ode/ContinuousOutputFieldModelTest.java |   2 +-
 .../legacy/ode/ContinuousOutputModelTest.java      |  51 +++--
 .../math4/legacy/ode/FieldExpandableODETest.java   |   2 +-
 .../math4/legacy/ode/FirstOrderConverterTest.java  |   2 +-
 .../math4/legacy/ode/JacobianMatricesTest.java     |   8 +-
 .../math4/legacy/ode/TestFieldProblem3.java        |   2 +-
 .../math4/legacy/ode/TestFieldProblem4.java        |   9 +-
 .../math4/legacy/ode/TestFieldProblemAbstract.java |   4 +-
 .../commons/math4/legacy/ode/TestProblem3.java     |   2 +-
 .../commons/math4/legacy/ode/TestProblem4.java     |   4 +-
 .../math4/legacy/ode/TestProblemAbstract.java      |   5 +-
 .../math4/legacy/ode/events/CloseEventsTest.java   |   2 +-
 .../math4/legacy/ode/events/EventFilterTest.java   |   2 +-
 .../math4/legacy/ode/events/EventStateTest.java    |  15 +-
 .../legacy/ode/events/OverlappingEventsTest.java   |   2 +-
 ...tractEmbeddedRungeKuttaFieldIntegratorTest.java |  10 +-
 .../AbstractRungeKuttaFieldIntegratorTest.java     |   2 +-
 .../ode/nonstiff/AdamsBashforthIntegratorTest.java |   4 +-
 .../nonstiff/AdamsFieldIntegratorAbstractTest.java |  12 +-
 .../ode/nonstiff/AdamsMoultonIntegratorTest.java   |   4 +-
 .../ClassicalRungeKuttaIntegratorTest.java         |   2 +-
 .../ClassicalRungeKuttaStepInterpolatorTest.java   |   2 +-
 .../math4/legacy/ode/nonstiff/Decimal64Field.java  |   2 +-
 .../math4/legacy/ode/nonstiff/Decimal64Test.java   |  19 +-
 .../nonstiff/DormandPrince54IntegratorTest.java    |   6 +-
 .../DormandPrince54StepInterpolatorTest.java       |   2 +-
 .../nonstiff/DormandPrince853IntegratorTest.java   |  10 +-
 .../DormandPrince853StepInterpolatorTest.java      |   2 +-
 ...eddedRungeKuttaFieldIntegratorAbstractTest.java |  10 +-
 .../ode/nonstiff/EulerStepInterpolatorTest.java    |   2 +-
 .../legacy/ode/nonstiff/GillIntegratorTest.java    |   2 +-
 .../ode/nonstiff/GillStepInterpolatorTest.java     |   2 +-
 .../nonstiff/GraggBulirschStoerIntegratorTest.java |   2 +-
 .../GraggBulirschStoerStepInterpolatorTest.java    |   2 +-
 .../nonstiff/HighamHall54StepInterpolatorTest.java |   2 +-
 .../legacy/ode/nonstiff/LutherIntegratorTest.java  |   2 +-
 .../ode/nonstiff/LutherStepInterpolatorTest.java   |   2 +-
 .../ode/nonstiff/MidpointStepInterpolatorTest.java |   2 +-
 .../RungeKuttaFieldIntegratorAbstractTest.java     |   2 +-
 ...ungeKuttaFieldStepInterpolatorAbstractTest.java |   2 +-
 .../ode/nonstiff/ThreeEighthesIntegratorTest.java  |   2 +-
 .../ThreeEighthesStepInterpolatorTest.java         |   2 +-
 .../ode/sampling/DummyStepInterpolatorTest.java    |   2 +-
 .../sampling/NordsieckStepInterpolatorTest.java    |   2 +-
 .../ode/sampling/StepInterpolatorTestUtils.java    |   5 +-
 .../legacy/ode/sampling/StepNormalizerTest.java    |   6 +-
 .../legacy/optim/linear/SimplexSolverTest.java     |   6 +-
 .../MultiStartMultivariateOptimizerTest.java       |   2 +-
 .../MultivariateFunctionMappingAdapterTest.java    |   6 +-
 .../MultivariateFunctionPenaltyAdapterTest.java    |   6 +-
 .../NonLinearConjugateGradientOptimizerTest.java   |   8 +-
 .../scalar/noderiv/CMAESOptimizerTest.java         |  32 +--
 .../nonlinear/scalar/noderiv/OptimTestUtils.java   |  36 +--
 .../SimplexOptimizerMultiDirectionalTest.java      |   1 -
 .../legacy/optim/univariate/BracketFinderTest.java |   8 +-
 .../MultiStartUnivariateOptimizerTest.java         |   6 +-
 .../legacy/random/CorrelatedVectorFactoryTest.java |   2 -
 .../legacy/random/StableRandomGeneratorTest.java   |   2 +-
 .../commons/math4/legacy/stat/FrequencyTest.java   |  18 +-
 .../AggregateSummaryStatisticsTest.java            |   2 +-
 .../descriptive/DescriptiveStatisticsTest.java     |  28 +--
 .../stat/descriptive/DoubleArrayAbstractTest.java  |   1 -
 .../MultivariateSummaryStatisticsTest.java         |   8 +-
 .../descriptive/StatisticalSummaryValuesTest.java  |   2 +-
 .../stat/descriptive/rank/KthSelectorTest.java     |   1 -
 .../descriptive/rank/PSquarePercentileTest.java    |  20 +-
 .../stat/descriptive/rank/PercentileTest.java      |  29 ++-
 .../legacy/stat/inference/ChiSquareTestTest.java   |   9 +-
 .../stat/inference/KolmogorovSmirnovTestTest.java  |   5 +-
 .../math4/legacy/stat/inference/TTestTest.java     |   2 +-
 .../legacy/stat/ranking/NaturalRankingTest.java    |  24 +-
 .../GLSMultipleLinearRegressionTest.java           |   4 +-
 .../regression/MillerUpdatingRegressionTest.java   |  10 +-
 .../OLSMultipleLinearRegressionTest.java           |   8 +-
 .../math4/legacy/util/CombinatoricsUtilsTest.java  |   6 +-
 .../legacy/util/ComplexFormatAbstractTest.java     |  23 +-
 .../resources/checkstyle/checkstyle-legacy.xml     | 175 ++++++++++++++-
 .../checkstyle/checkstyle-suppressions-legacy.xml  |  22 ++
 356 files changed, 1928 insertions(+), 1668 deletions(-)

diff --git a/commons-math-legacy/pom.xml b/commons-math-legacy/pom.xml
index 9f2438c..345d18f 100644
--- a/commons-math-legacy/pom.xml
+++ b/commons-math-legacy/pom.xml
@@ -149,6 +149,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <configuration>
+          <enableRulesSummary>true</enableRulesSummary>
           <configLocation>${math.parent.dir}/src/main/resources/checkstyle/checkstyle-legacy.xml</configLocation>
           <suppressionsLocation>${math.parent.dir}/src/main/resources/checkstyle/checkstyle-suppressions-legacy.xml</suppressionsLocation>
         </configuration>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java
index 65eb6aa..72a9397 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/FunctionUtils.java
@@ -23,16 +23,14 @@ import org.apache.commons.math4.legacy.analysis.differentiation.MultivariateDiff
 import org.apache.commons.math4.legacy.analysis.differentiation.UnivariateDifferentiableFunction;
 import org.apache.commons.math4.legacy.analysis.function.Identity;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
-import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException;
 import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException;
-import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
 
 /**
  * Utilities for manipulating function objects.
  *
  * @since 3.0
  */
-public class FunctionUtils {
+public final class FunctionUtils {
     /**
      * Class only contains static methods.
      */
@@ -208,7 +206,7 @@ public class FunctionUtils {
 
     /**
      * Returns the univariate function
-     * {@code h(x) = combiner(f(x), g(x)).}
+     * {@code h(x) = combiner(f(x), g(x))}.
      *
      * @param combiner Combiner function.
      * @param f Function.
@@ -228,7 +226,8 @@ public class FunctionUtils {
     }
 
     /**
-     * Returns a MultivariateFunction h(x[]) defined by <pre> <code>
+     * Returns a MultivariateFunction h(x[]). Defined by:
+     * <pre> <code>
      * h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1]))
      * </code></pre>
      *
@@ -254,7 +253,8 @@ public class FunctionUtils {
     }
 
     /**
-     * Returns a MultivariateFunction h(x[]) defined by <pre> <code>
+     * Returns a MultivariateFunction h(x[]). Defined by:
+     * <pre> <code>
      * h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1])
      * </code></pre>
      *
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java
index 3a4007f..dc19319 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java
@@ -122,9 +122,9 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  * @see DerivativeStructure
  * @since 3.1
  */
-public class DSCompiler {
+public final class DSCompiler {
     /** Cache for factorials. */
-    private static FactorialDouble FACTORIAL = FactorialDouble.create().withCache(30);
+    private static final FactorialDouble FACTORIAL = FactorialDouble.create().withCache(30);
 
     /** Array of all compilers created so far. */
     private static AtomicReference<DSCompiler[][]> compilers =
@@ -347,7 +347,7 @@ public class DSCompiler {
                                                            final DSCompiler derivativeCompiler,
                                                            final int[] lowerIndirection) {
 
-        if ((parameters == 0) || (order == 0)) {
+        if (parameters == 0 || order == 0) {
             return new int[][][] { { { 1, 0, 0 } } };
         }
 
@@ -414,7 +414,7 @@ public class DSCompiler {
                                                            final int[][] derivativesIndirection)
        throws NumberIsTooLargeException {
 
-        if ((parameters == 0) || (order == 0)) {
+        if (parameters == 0 || order == 0) {
             return new int[][][] { { { 1, 0 } } };
         }
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
index f2c03cf..11fc04d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructure.java
@@ -676,7 +676,7 @@ public class DerivativeStructure implements RealFieldElement<DerivativeStructure
         };
     }
 
-    /** Compute a<sup>x</sup> where a is a double and x a {@link DerivativeStructure}
+    /** Compute a<sup>x</sup> where a is a double and x a {@link DerivativeStructure}.
      * @param a number to exponentiate
      * @param x power to apply
      * @return a<sup>x</sup>
@@ -917,7 +917,7 @@ public class DerivativeStructure implements RealFieldElement<DerivativeStructure
         return result;
     }
 
-    /** Convert radians to degrees, with error of less than 0.5 ULP
+    /** Convert radians to degrees, with error of less than 0.5 ULP.
      *  @return instance converted into degrees
      */
     public DerivativeStructure toDegrees() {
@@ -928,7 +928,7 @@ public class DerivativeStructure implements RealFieldElement<DerivativeStructure
         return ds;
     }
 
-    /** Convert degrees to radians, with error of less than 0.5 ULP
+    /** Convert degrees to radians, with error of less than 0.5 ULP.
      *  @return instance converted into radians
      */
     public DerivativeStructure toRadians() {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java
index d247544..035ac36 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradient.java
@@ -26,7 +26,6 @@ import org.apache.commons.numbers.core.Precision;
 import org.apache.commons.math4.legacy.core.Field;
 import org.apache.commons.math4.legacy.core.FieldElement;
 import org.apache.commons.math4.legacy.core.RealFieldElement;
-import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 
 /**
@@ -41,7 +40,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  *
  * @since 3.3
  */
-public class SparseGradient implements RealFieldElement<SparseGradient>, Serializable {
+public final class SparseGradient implements RealFieldElement<SparseGradient>, Serializable {
 
     /** Serializable UID. */
     private static final long serialVersionUID = 20131025L;
@@ -89,7 +88,7 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
      * @return a new instance
      */
     public static SparseGradient createConstant(final double value) {
-        return new SparseGradient(value, Collections.<Integer, Double> emptyMap());
+        return new SparseGradient(value, Collections.<Integer, Double>emptyMap());
     }
 
     /** Factory method creating an independent variable.
@@ -209,7 +208,7 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
     @Override
     public SparseGradient multiply(final SparseGradient a) {
         final SparseGradient out =
-            new SparseGradient(value * a.value, Collections.<Integer, Double> emptyMap());
+            new SparseGradient(value * a.value, Collections.<Integer, Double>emptyMap());
 
         // Derivatives.
         for (Map.Entry<Integer, Double> entry : derivatives.entrySet()) {
@@ -271,7 +270,7 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
     /** {@inheritDoc} */
     @Override
     public SparseGradient divide(final SparseGradient a) {
-        final SparseGradient out = new SparseGradient(value / a.value, Collections.<Integer, Double> emptyMap());
+        final SparseGradient out = new SparseGradient(value / a.value, Collections.<Integer, Double>emptyMap());
 
         // Derivatives.
         for (Map.Entry<Integer, Double> entry : derivatives.entrySet()) {
@@ -411,7 +410,7 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
     /** {@inheritDoc} */
     @Override
     public SparseGradient scalb(final int n) {
-        final SparseGradient out = new SparseGradient(AccurateMath.scalb(value, n), Collections.<Integer, Double> emptyMap());
+        final SparseGradient out = new SparseGradient(AccurateMath.scalb(value, n), Collections.<Integer, Double>emptyMap());
         for (Map.Entry<Integer, Double> entry : derivatives.entrySet()) {
             out.derivatives.put(entry.getKey(), AccurateMath.scalb(entry.getValue(), n));
         }
@@ -530,7 +529,7 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
         return log().multiply(e).exp();
     }
 
-    /** Compute a<sup>x</sup> where a is a double and x a {@link SparseGradient}
+    /** Compute a<sup>x</sup> where a is a double and x a {@link SparseGradient}.
      * @param a number to exponentiate
      * @param x power to apply
      * @return a<sup>x</sup>
@@ -694,14 +693,14 @@ public class SparseGradient implements RealFieldElement<SparseGradient>, Seriali
         return new SparseGradient(AccurateMath.atanh(value), 1.0 / (1.0 - value * value), derivatives);
     }
 
-    /** Convert radians to degrees, with error of less than 0.5 ULP
+    /** Convert radians to degrees, with error of less than 0.5 ULP.
      *  @return instance converted into degrees
      */
     public SparseGradient toDegrees() {
         return new SparseGradient(AccurateMath.toDegrees(value), AccurateMath.toDegrees(1.0), derivatives);
     }
 
-    /** Convert degrees to radians, with error of less than 0.5 ULP
+    /** Convert degrees to radians, with error of less than 0.5 ULP.
      *  @return instance converted into radians
      */
     public SparseGradient toRadians() {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Gaussian.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Gaussian.java
index b5c6af4..92f3fbc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Gaussian.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Gaussian.java
@@ -94,7 +94,7 @@ public class Gaussian implements UnivariateDifferentiableFunction {
 
     /**
      * Parametric function where the input array contains the parameters of
-     * the Gaussian, ordered as follows:
+     * the Gaussian. Ordered as follows:
      * <ul>
      *  <li>Norm</li>
      *  <li>Mean</li>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/HarmonicOscillator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/HarmonicOscillator.java
index 4c8a29e..b0c03e3 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/HarmonicOscillator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/HarmonicOscillator.java
@@ -61,7 +61,7 @@ public class HarmonicOscillator implements UnivariateDifferentiableFunction {
 
     /**
      * Parametric function where the input array contains the parameters of
-     * the harmonic oscillator function, ordered as follows:
+     * the harmonic oscillator function. Ordered as follows:
      * <ul>
      *  <li>Amplitude</li>
      *  <li>Angular frequency</li>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logistic.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logistic.java
index 18c2770..9dc43c9 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logistic.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logistic.java
@@ -86,7 +86,7 @@ public class Logistic implements UnivariateDifferentiableFunction {
     /**
      * Parametric function where the input array contains the parameters of
      * the {@link Logistic#Logistic(double,double,double,double,double,double)
-     * logistic function}, ordered as follows:
+     * logistic function}. Ordered as follows:
      * <ul>
      *  <li>k</li>
      *  <li>m</li>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logit.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logit.java
index c04baf6..0da8537 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logit.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Logit.java
@@ -67,7 +67,7 @@ public class Logit implements UnivariateDifferentiableFunction {
 
     /**
      * Parametric function where the input array contains the parameters of
-     * the logit function, ordered as follows:
+     * the logit function. Ordered as follows:
      * <ul>
      *  <li>Lower bound</li>
      *  <li>Higher bound</li>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Sigmoid.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Sigmoid.java
index 811fb8a..2f1dfe5 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Sigmoid.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/function/Sigmoid.java
@@ -69,7 +69,7 @@ public class Sigmoid implements UnivariateDifferentiableFunction {
 
     /**
      * Parametric function where the input array contains the parameters of
-     * the {@link Sigmoid#Sigmoid(double,double) sigmoid function}, ordered
+     * the {@link Sigmoid#Sigmoid(double,double) sigmoid function}. Ordered
      * as follows:
      * <ul>
      *  <li>Lower asymptote</li>
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/BaseAbstractUnivariateIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/BaseAbstractUnivariateIntegrator.java
index b4f4345..e004199 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/BaseAbstractUnivariateIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/BaseAbstractUnivariateIntegrator.java
@@ -53,9 +53,9 @@ public abstract class BaseAbstractUnivariateIntegrator implements UnivariateInte
     /** Maximum relative error. */
     private final double relativeAccuracy;
 
-    /** minimum number of iterations */
+    /** minimum number of iterations. */
     private final int minimalIterationCount;
-    /** maximum number of iterations */
+    /** maximum number of iterations. */
     private final int maximalIterationCount;
 
     /** The functions evaluation count. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegrator.java
index 771a7b8..8ce1d90 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegrator.java
@@ -84,7 +84,7 @@ public class RombergIntegrator extends BaseAbstractUnivariateIntegrator {
 
     /**
      * Construct a Romberg integrator with default settings
-     * (max iteration count set to {@link #ROMBERG_MAX_ITERATIONS_COUNT})
+     * (max iteration count set to {@link #ROMBERG_MAX_ITERATIONS_COUNT}).
      */
     public RombergIntegrator() {
         super(DEFAULT_MIN_ITERATIONS_COUNT, ROMBERG_MAX_ITERATIONS_COUNT);
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/BaseRuleFactory.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/BaseRuleFactory.java
index f36fdbd..13d04d6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/BaseRuleFactory.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/BaseRuleFactory.java
@@ -126,7 +126,7 @@ public abstract class BaseRuleFactory<T extends Number> {
     protected abstract Pair<T[], T[]> computeRule(int numberOfPoints);
 
     /**
-     * Converts the from the actual {@code Number} type to {@code double}
+     * Converts the from the actual {@code Number} type to {@code double}.
      *
      * @param <T> Type of the number used to represent the points and
      * weights of the quadrature rules.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/HermiteRuleFactory.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/HermiteRuleFactory.java
index fddf695..79dc3cd 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/HermiteRuleFactory.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/gauss/HermiteRuleFactory.java
@@ -48,11 +48,11 @@ import org.apache.commons.math4.legacy.core.Pair;
  * @since 3.3
  */
 public class HermiteRuleFactory extends BaseRuleFactory<Double> {
-    /** &pi;<sup>1/2</sup> */
+    /** &pi;<sup>1/2</sup>. */
     private static final double SQRT_PI = 1.77245385090551602729;
-    /** &pi;<sup>-1/4</sup> */
+    /** &pi;<sup>-1/4</sup>. */
     private static final double H0 = 7.5112554446494248286e-1;
-    /** &pi;<sup>-1/4</sup> &radic;2 */
+    /** &pi;<sup>-1/4</sup> &radic;2. */
     private static final double H1 = 1.0622519320271969145;
 
     /** {@inheritDoc} */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java
index 7e493f7..fda6349 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunction.java
@@ -39,7 +39,7 @@ public class BicubicInterpolatingFunction
     private static final int NUM_COEFF = 16;
     /**
      * Matrix to compute the spline coefficients from the function values
-     * and function derivatives values
+     * and function derivatives values.
      */
     private static final double[][] AINV = {
         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
@@ -60,11 +60,11 @@ public class BicubicInterpolatingFunction
         { 4,-4,-4,4,2,2,-2,-2,2,-2,2,-2,1,1,1,1 }
     };
 
-    /** Samples x-coordinates */
+    /** Samples x-coordinates. */
     private final double[] xval;
-    /** Samples y-coordinates */
+    /** Samples y-coordinates. */
     private final double[] yval;
-    /** Set of cubic splines patching the whole data grid */
+    /** Set of cubic splines patching the whole data grid. */
     private final BicubicFunction[][] splines;
 
     /**
@@ -175,14 +175,10 @@ public class BicubicInterpolatingFunction
      * @return {@code true} if (x, y) is a valid point.
      */
     public boolean isValidPoint(double x, double y) {
-        if (x < xval[0] ||
+        return !(x < xval[0] ||
             x > xval[xval.length - 1] ||
             y < yval[0] ||
-            y > yval[yval.length - 1]) {
-            return false;
-        } else {
-            return true;
-        }
+            y > yval[yval.length - 1]);
     }
 
     /**
@@ -268,7 +264,7 @@ public class BicubicInterpolatingFunction
 class BicubicFunction implements BivariateFunction {
     /** Number of points. */
     private static final short N = 4;
-    /** Coefficients */
+    /** Coefficients. */
     private final double[][] a;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolator.java
index 97a6b89..839d111 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolator.java
@@ -100,14 +100,10 @@ public class BicubicInterpolator
             /** {@inheritDoc} */
             @Override
             public boolean isValidPoint(double x, double y) {
-                if (x < xval[1] ||
+                return !(x < xval[1] ||
                     x > xval[xval.length - 2] ||
                     y < yval[1] ||
-                    y > yval[yval.length - 2]) {
-                    return false;
-                } else {
-                    return true;
-                }
+                    y > yval[yval.length - 2]);
             }
         };
     }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolator.java
index 95a7115..9a7e474 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolator.java
@@ -38,7 +38,7 @@ import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
  */
 public class DividedDifferenceInterpolator
     implements UnivariateInterpolator, Serializable {
-    /** serializable version identifier */
+    /** serializable version identifier. */
     private static final long serialVersionUID = 107049519551235069L;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
index 37557aa..c9481d2 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
@@ -444,7 +444,7 @@ public class LoessInterpolator
     /**
      * Compute the
      * <a href="http://en.wikipedia.org/wiki/Local_regression#Weight_function">tricube</a>
-     * weight function
+     * weight function.
      *
      * @param x Argument.
      * @return <code>(1 - |x|<sup>3</sup>)<sup>3</sup></code> for |x| &lt; 1, 0 otherwise.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolator.java
index 5d978b9..dadde89 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolator.java
@@ -37,7 +37,7 @@ import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
 public class NevilleInterpolator implements UnivariateInterpolator,
     Serializable {
 
-    /** serializable version identifier */
+    /** serializable version identifier. */
     static final long serialVersionUID = 3003707660147873733L;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunction.java
index 31e0c52..587310d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatingFunction.java
@@ -43,11 +43,11 @@ public class PiecewiseBicubicSplineInterpolatingFunction
     implements BivariateFunction {
     /** The minimum number of points that are needed to compute the function. */
     private static final int MIN_NUM_POINTS = 5;
-    /** Samples x-coordinates */
+    /** Samples x-coordinates. */
     private final double[] xval;
-    /** Samples y-coordinates */
+    /** Samples y-coordinates. */
     private final double[] yval;
-    /** Set of cubic splines patching the whole data grid */
+    /** Set of cubic splines patching the whole data grid. */
     private final double[][] fval;
 
     /**
@@ -157,14 +157,10 @@ public class PiecewiseBicubicSplineInterpolatingFunction
      */
     public boolean isValidPoint(double x,
                                 double y) {
-        if (x < xval[0] ||
+        return !(x < xval[0] ||
             x > xval[xval.length - 1] ||
             y < yval[0] ||
-            y > yval[yval.length - 1]) {
-            return false;
-        } else {
-            return true;
-        }
+            y > yval[yval.length - 1]);
     }
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java
index 0977eb8..7e72067 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java
@@ -39,7 +39,7 @@ public class TricubicInterpolatingFunction
     implements TrivariateFunction {
     /**
      * Matrix to compute the spline coefficients from the function values
-     * and function derivatives values
+     * and function derivatives values.
      */
     private static final double[][] AINV = {
         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
@@ -108,13 +108,13 @@ public class TricubicInterpolatingFunction
         { 8,-8,-8,8,-8,8,8,-8,4,4,-4,-4,-4,-4,4,4,4,-4,4,-4,-4,4,-4,4,4,-4,-4,4,4,-4,-4,4,2,2,2,2,-2,-2,-2,-2,2,2,-2,-2,2,2,-2,-2,2,-2,2,-2,2,-2,2,-2,1,1,1,1,1,1,1,1 }
     };
 
-    /** Samples x-coordinates */
+    /** Samples x-coordinates. */
     private final double[] xval;
-    /** Samples y-coordinates */
+    /** Samples y-coordinates. */
     private final double[] yval;
-    /** Samples z-coordinates */
+    /** Samples z-coordinates. */
     private final double[] zval;
-    /** Set of cubic splines patching the whole data grid */
+    /** Set of cubic splines patching the whole data grid. */
     private final TricubicFunction[][][] splines;
 
     /**
@@ -341,16 +341,12 @@ public class TricubicInterpolatingFunction
      * @return {@code true} if (x, y, z) is a valid point.
      */
     public boolean isValidPoint(double x, double y, double z) {
-        if (x < xval[0] ||
+        return !(x < xval[0] ||
             x > xval[xval.length - 1] ||
             y < yval[0] ||
             y > yval[yval.length - 1] ||
             z < zval[0] ||
-            z > zval[zval.length - 1]) {
-            return false;
-        } else {
-            return true;
-        }
+            z > zval[zval.length - 1]);
     }
 
     /**
@@ -447,7 +443,7 @@ class TricubicFunction
     implements TrivariateFunction {
     /** Number of points. */
     private static final short N = 4;
-    /** Coefficients */
+    /** Coefficients. */
     private final double[][][] a = new double[N][N][N];
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolator.java
index 0ff84eb..f7c5f0d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolator.java
@@ -128,16 +128,12 @@ public class TricubicInterpolator
             /** {@inheritDoc} */
             @Override
             public boolean isValidPoint(double x, double y, double z) {
-                if (x < xval[1] ||
+                return !(x < xval[1] ||
                     x > xval[xval.length - 2] ||
                     y < yval[1] ||
                     y > yval[yval.length - 2] ||
                     z < zval[1] ||
-                    z > zval[zval.length - 2]) {
-                    return false;
-                } else {
-                    return true;
-                }
+                    z > zval[zval.length - 2]);
             }
         };
     }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunction.java
index 29f7dc6..dd382dd 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunction.java
@@ -36,7 +36,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class PolynomialFunction implements UnivariateDifferentiableFunction, Serializable {
     /**
-     * Serialization identifier
+     * Serialization identifier.
      */
     private static final long serialVersionUID = -7726511984200295583L;
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeForm.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeForm.java
index 57af1ab..c0fe244 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeForm.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeForm.java
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.math4.legacy.analysis.polynomials;
 
-import org.apache.commons.numbers.core.Precision;
 import org.apache.commons.numbers.arrays.SortInPlace;
 import org.apache.commons.math4.legacy.analysis.UnivariateFunction;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
@@ -211,16 +210,16 @@ public class PolynomialFunctionLagrangeForm implements UnivariateFunction {
         final int n = x.length;
         final double[] c = new double[n];
         final double[] d = new double[n];
-        double min_dist = Double.POSITIVE_INFINITY;
+        double minDist = Double.POSITIVE_INFINITY;
         for (int i = 0; i < n; i++) {
             // initialize the difference arrays
             c[i] = y[i];
             d[i] = y[i];
             // find out the abscissa closest to z
             final double dist = AccurateMath.abs(z - x[i]);
-            if (dist < min_dist) {
+            if (dist < minDist) {
                 nearest = i;
-                min_dist = dist;
+                minDist = dist;
             }
         }
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialSplineFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialSplineFunction.java
index e232c97..5c390eb 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialSplineFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialSplineFunction.java
@@ -227,11 +227,7 @@ public class PolynomialSplineFunction implements UnivariateDifferentiableFunctio
      * @return {@code true} if {@code x} is a valid point.
      */
     public boolean isValidPoint(double x) {
-        if (x < knots[0] ||
-            x > knots[n]) {
-            return false;
-        } else {
-            return true;
-        }
+        return !(x < knots[0] ||
+            x > knots[n]);
     }
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
index 6497c73..44da4c1 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtils.java
@@ -30,10 +30,10 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  *
  * @since 2.0
  */
-public class PolynomialsUtils {
-    /** -1 */
+public final class PolynomialsUtils {
+    /** -1. */
     private static final BigFraction BF_MINUS_ONE = BigFraction.of(-1);
-    /** 2 */
+    /** 2. */
     private static final BigFraction BF_TWO = BigFraction.of(2);
 
     /** Coefficients for Chebyshev polynomials. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolver.java
index 3bad262..4a41726 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolver.java
@@ -63,7 +63,7 @@ public class BracketingNthOrderBrentSolver
     private AllowedSolution allowed;
 
     /**
-     * Construct a solver with default accuracy and maximal order (1e-6 and 5 respectively)
+     * Construct a solver with default accuracy and maximal order (1e-6 and 5 respectively).
      */
     public BracketingNthOrderBrentSolver() {
         this(DEFAULT_ABSOLUTE_ACCURACY, DEFAULT_MAXIMAL_ORDER);
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
index 008e25e..cd20e75 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
@@ -357,14 +357,14 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
                 }
 
                 // Now pv != 0, calculate the new approximation.
-                final Complex G = dv.divide(pv);
-                final Complex G2 = G.multiply(G);
-                final Complex H = G2.subtract(d2v.divide(pv));
-                final Complex delta = n1C.multiply((nC.multiply(H)).subtract(G2));
+                final Complex g = dv.divide(pv);
+                final Complex g2 = g.multiply(g);
+                final Complex h = g2.subtract(d2v.divide(pv));
+                final Complex delta = n1C.multiply((nC.multiply(h)).subtract(g2));
                 // Choose a denominator larger in magnitude.
                 final Complex deltaSqrt = delta.sqrt();
-                final Complex dplus = G.add(deltaSqrt);
-                final Complex dminus = G.subtract(deltaSqrt);
+                final Complex dplus = g.add(deltaSqrt);
+                final Complex dminus = g.subtract(deltaSqrt);
                 final Complex denominator = dplus.abs() > dminus.abs() ? dplus : dminus;
                 // Perturb z if denominator is zero, for instance,
                 // p(x) = x^3 + 1, z = 0.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/UnivariateSolverUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/UnivariateSolverUtils.java
index d734345..daace2d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/UnivariateSolverUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/UnivariateSolverUtils.java
@@ -28,7 +28,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  * Utility routines for {@link UnivariateSolver} objects.
  *
  */
-public class UnivariateSolverUtils {
+public final class UnivariateSolverUtils {
     /**
      * Class contains only static methods.
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistribution.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistribution.java
index 47814f9..c8f5021 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistribution.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistribution.java
@@ -103,37 +103,37 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class EmpiricalDistribution extends AbstractRealDistribution
     implements ContinuousDistribution {
 
-    /** Default bin count */
+    /** Default bin count. */
     public static final int DEFAULT_BIN_COUNT = 1000;
 
-    /** Character set for file input */
+    /** Character set for file input. */
     private static final String FILE_CHARSET = "US-ASCII";
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 5729073523949762654L;
 
-    /** List of SummaryStatistics objects characterizing the bins */
+    /** List of SummaryStatistics objects characterizing the bins. */
     private final List<SummaryStatistics> binStats;
 
-    /** Sample statistics */
+    /** Sample statistics. */
     private SummaryStatistics sampleStats;
 
-    /** Max loaded value */
+    /** Max loaded value. */
     private double max = Double.NEGATIVE_INFINITY;
 
-    /** Min loaded value */
+    /** Min loaded value. */
     private double min = Double.POSITIVE_INFINITY;
 
-    /** Grid size */
+    /** Grid size. */
     private double delta;
 
-    /** number of bins */
+    /** number of bins. */
     private final int binCount;
 
     /** is the distribution loaded? */
     private boolean loaded;
 
-    /** upper bounds of subintervals in (0,1) "belonging" to the bins */
+    /** upper bounds of subintervals in (0,1) "belonging" to the bins. */
     private double[] upperBounds;
 
     /**
@@ -269,15 +269,15 @@ public class EmpiricalDistribution extends AbstractRealDistribution
     }
 
     /**
-     * <code>DataAdapter</code> for data provided through some input stream
+     * <code>DataAdapter</code> for data provided through some input stream.
      */
     private class StreamDataAdapter extends DataAdapter{
 
-        /** Input stream providing access to the data */
+        /** Input stream providing access to the data. */
         private BufferedReader inputStream;
 
         /**
-         * Create a StreamDataAdapter from a BufferedReader
+         * Create a StreamDataAdapter from a BufferedReader.
          *
          * @param in BufferedReader input stream
          */
@@ -321,11 +321,11 @@ public class EmpiricalDistribution extends AbstractRealDistribution
      */
     private class ArrayDataAdapter extends DataAdapter {
 
-        /** Array of input  data values */
+        /** Array of input  data values. */
         private final double[] inputArray;
 
         /**
-         * Construct an ArrayDataAdapter from a double[] array
+         * Construct an ArrayDataAdapter from a double[] array.
          *
          * @param in double[] array holding the data
          * @throws NullArgumentException if in is null
@@ -393,7 +393,7 @@ public class EmpiricalDistribution extends AbstractRealDistribution
     }
 
     /**
-     * Returns the index of the bin to which the given value belongs
+     * Returns the index of the bin to which the given value belongs.
      *
      * @param value  the value whose bin we are trying to find
      * @return the index of the bin containing the value
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/MixtureMultivariateRealDistribution.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/MixtureMultivariateRealDistribution.java
index 086df0a..67395e7 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/MixtureMultivariateRealDistribution.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/distribution/MixtureMultivariateRealDistribution.java
@@ -117,7 +117,7 @@ public class MixtureMultivariateRealDistribution<T extends MultivariateRealDistr
      * Sampler.
      */
     private class MixtureSampler implements MultivariateRealDistribution.Sampler {
-        /** RNG */
+        /** RNG. */
         private final UniformRandomProvider rng;
         /** Sampler for each of the distribution in the mixture. */
         private final MultivariateRealDistribution.Sampler[] samplers;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldDecompositionSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldDecompositionSolver.java
index d90e14d..54dcade 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldDecompositionSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldDecompositionSolver.java
@@ -46,7 +46,7 @@ public interface FieldDecompositionSolver<T> {
      * @return the matrix {@code X} that minimizes {@code ||A X - B||}.
      * @throws IllegalArgumentException if the dimensions do not match.
      */
-    FieldDenseMatrix<T> solve(final FieldDenseMatrix<T> b);
+    FieldDenseMatrix<T> solve(FieldDenseMatrix<T> b);
 
     /**
      * Computes the inverse of a decomposed (square) matrix.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldLUDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldLUDecomposition.java
index 83595ef..0bfd700 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldLUDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/field/linalg/FieldLUDecomposition.java
@@ -40,7 +40,7 @@ import org.apache.commons.math4.legacy.linear.SingularMatrixException;
  *
  * @since 4.0
  */
-public class FieldLUDecomposition<T> {
+public final class FieldLUDecomposition<T> {
     /** Field to which the elements belong. */
     private final Field<T> field;
     /** Entries of LU decomposition. */
@@ -279,7 +279,7 @@ public class FieldLUDecomposition<T> {
      *
      * @param <T> Type of the field elements.
      */
-    private static class Solver<T> implements FieldDecompositionSolver<T> {
+    private static final class Solver<T> implements FieldDecompositionSolver<T> {
         /** Field to which the elements belong. */
         private final Field<T> field;
         /** LU decomposition. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/GaussianCurveFitter.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/GaussianCurveFitter.java
index e2d8897..28e3170 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/GaussianCurveFitter.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/GaussianCurveFitter.java
@@ -62,7 +62,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  *
  * @since 3.3
  */
-public class GaussianCurveFitter extends SimpleCurveFitter {
+public final class GaussianCurveFitter extends SimpleCurveFitter {
     /** Parametric function to be fitted. */
     private static final Gaussian.Parametric FUNCTION = new Gaussian.Parametric() {
             /** {@inheritDoc} */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitter.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitter.java
index 5642113..c29a14c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitter.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitter.java
@@ -16,10 +16,7 @@
  */
 package org.apache.commons.math4.legacy.fitting;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
-
 import org.apache.commons.math4.legacy.analysis.function.HarmonicOscillator;
 import org.apache.commons.math4.legacy.exception.MathIllegalStateException;
 import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
@@ -43,7 +40,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  *
  * @since 3.3
  */
-public class HarmonicCurveFitter extends SimpleCurveFitter {
+public final class HarmonicCurveFitter extends SimpleCurveFitter {
     /** Parametric function to be fitted. */
     private static final HarmonicOscillator.Parametric FUNCTION = new HarmonicOscillator.Parametric();
 
@@ -188,6 +185,7 @@ public class HarmonicCurveFitter extends SimpleCurveFitter {
          * @throws MathIllegalStateException when the guessing procedure cannot
          * produce sensible results.
          */
+        @Override
         public double[] guess(Collection<WeightedObservedPoint> observations) {
             if (observations.size() < 4) {
                 throw new NumberIsTooSmallException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitter.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitter.java
index 9360b80..bc083be 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitter.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitter.java
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.math4.legacy.fitting;
 
-import java.util.Collection;
-
 import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialFunction;
 
 /**
@@ -32,7 +30,7 @@ import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialFunction;
  *
  * @since 3.3
  */
-public class PolynomialCurveFitter extends SimpleCurveFitter {
+public final class PolynomialCurveFitter extends SimpleCurveFitter {
     /** Parametric function to be fitted. */
     private static final PolynomialFunction.Parametric FUNCTION = new PolynomialFunction.Parametric();
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/SimpleCurveFitter.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/SimpleCurveFitter.java
index 832168f..671150d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/SimpleCurveFitter.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/SimpleCurveFitter.java
@@ -162,8 +162,9 @@ public class SimpleCurveFitter extends AbstractCurveFitter {
     /**
      * Guesses the parameters.
      */
-    public static abstract class ParameterGuesser {
-        private final Comparator<WeightedObservedPoint> CMP = new Comparator<WeightedObservedPoint>() {
+    public abstract static class ParameterGuesser {
+        /** Comparator. */
+        private static final Comparator<WeightedObservedPoint> CMP = new Comparator<WeightedObservedPoint>() {
                 /** {@inheritDoc} */
                 @Override
                 public int compare(WeightedObservedPoint p1,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractEvaluation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractEvaluation.java
index d65f100..bb881e0 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractEvaluation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractEvaluation.java
@@ -34,7 +34,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public abstract class AbstractEvaluation implements Evaluation {
 
-    /** number of observations */
+    /** number of observations. */
     private final int observationSize;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DenseWeightedEvaluation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DenseWeightedEvaluation.java
index ac7619f..e5c00a1 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DenseWeightedEvaluation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DenseWeightedEvaluation.java
@@ -27,9 +27,9 @@ import org.apache.commons.math4.legacy.linear.RealVector;
  */
 class DenseWeightedEvaluation extends AbstractEvaluation {
 
-    /** the unweighted evaluation */
+    /** the unweighted evaluation. */
     private final Evaluation unweighted;
-    /** reference to the weight square root matrix */
+    /** reference to the weight square root matrix. */
     private final RealMatrix weightSqrt;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunction.java
index 34ce3bb..2db8e4b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunction.java
@@ -81,7 +81,7 @@ public class DifferentiatorVectorMultivariateJacobianFunction implements Multiva
     }
 
     /**
-     * Returns first order derivative for the function passed in using a differentiator
+     * Returns first order derivative for the function passed in using a differentiator.
      * @param univariateVectorFunction the function to differentiate
      * @param atParameterValue the point at which to differentiate it at
      * @return the slopes at that point
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/GaussNewtonOptimizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/GaussNewtonOptimizer.java
index a4d38db..6e97a2c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/GaussNewtonOptimizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/GaussNewtonOptimizer.java
@@ -261,7 +261,7 @@ public class GaussNewtonOptimizer implements LeastSquaresOptimizer {
      *
      * @param jacobian  the m by n jacobian matrix, J. Input.
      * @param residuals the m by 1 residual vector, r. Input.
-     * @return  the n by n normal matrix and  the n by 1 J<sup>Tr vector.
+     * @return  the n by n normal matrix and  the n by 1 J<sup>Tr</sup> vector.
      */
     private static Pair<RealMatrix, RealVector> computeNormalMatrix(final RealMatrix jacobian,
                                                                     final RealVector residuals) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresAdapter.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresAdapter.java
index 74228a0..7c5c728 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresAdapter.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresAdapter.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.legacy.core.IntegerSequence;
  */
 public class LeastSquaresAdapter implements LeastSquaresProblem {
 
-    /** the delegate problem */
+    /** the delegate problem. */
     private final LeastSquaresProblem problem;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresBuilder.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresBuilder.java
index a673425..2280c2b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresBuilder.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresBuilder.java
@@ -33,19 +33,19 @@ import org.apache.commons.math4.legacy.optim.PointVectorValuePair;
  */
 public class LeastSquaresBuilder {
 
-    /** max evaluations */
+    /** max evaluations. */
     private int maxEvaluations;
-    /** max iterations */
+    /** max iterations. */
     private int maxIterations;
-    /** convergence checker */
+    /** convergence checker. */
     private ConvergenceChecker<Evaluation> checker;
-    /** model function */
+    /** model function. */
     private MultivariateJacobianFunction model;
-    /** observed values */
+    /** observed values. */
     private RealVector target;
-    /** initial guess */
+    /** initial guess. */
     private RealVector start;
-    /** weight matrix */
+    /** weight matrix. */
     private RealMatrix weight;
     /**
      * Lazy evaluation.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresFactory.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresFactory.java
index 9400e8b..c923c09 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresFactory.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LeastSquaresFactory.java
@@ -39,7 +39,7 @@ import org.apache.commons.math4.legacy.core.Pair;
  *
  * @since 3.3
  */
-public class LeastSquaresFactory {
+public final class LeastSquaresFactory {
 
     /** Prevent instantiation. */
     private LeastSquaresFactory() {}
@@ -445,7 +445,7 @@ public class LeastSquaresFactory {
         /**
          * Container with the model evaluation at a particular point.
          */
-        private static class UnweightedEvaluation extends AbstractEvaluation {
+        private static final class UnweightedEvaluation extends AbstractEvaluation {
             /** Point of evaluation. */
             private final RealVector point;
             /** Derivative at point. */
@@ -493,7 +493,7 @@ public class LeastSquaresFactory {
         /**
          * Container with the model <em>lazy</em> evaluation at a particular point.
          */
-        private static class LazyUnweightedEvaluation extends AbstractEvaluation {
+        private static final class LazyUnweightedEvaluation extends AbstractEvaluation {
             /** Point of evaluation. */
             private final RealVector point;
             /** Model and Jacobian functions. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/OptimumImpl.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/OptimumImpl.java
index 3987bef..193daab 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/OptimumImpl.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/OptimumImpl.java
@@ -28,11 +28,11 @@ import org.apache.commons.math4.legacy.linear.RealVector;
  */
 class OptimumImpl implements Optimum {
 
-    /** abscissa and ordinate */
+    /** abscissa and ordinate. */
     private final Evaluation value;
-    /** number of evaluations to compute this optimum */
+    /** number of evaluations to compute this optimum. */
     private final int evaluations;
-    /** number of iterations to compute this optimum */
+    /** number of iterations to compute this optimum. */
     private final int iterations;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/ValueAndJacobianFunction.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/ValueAndJacobianFunction.java
index 02d9eb0..c05ce8f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/ValueAndJacobianFunction.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/ValueAndJacobianFunction.java
@@ -32,7 +32,7 @@ public interface ValueAndJacobianFunction extends MultivariateJacobianFunction {
      * @param params Point.
      * @return the value at the given point.
      */
-    RealVector computeValue(final double[] params);
+    RealVector computeValue(double[] params);
 
     /**
      * Compute the Jacobian.
@@ -40,5 +40,5 @@ public interface ValueAndJacobianFunction extends MultivariateJacobianFunction {
      * @param params Point.
      * @return the Jacobian at the given point.
      */
-    RealMatrix computeJacobian(final double[] params);
+    RealMatrix computeJacobian(double[] params);
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/AbstractListChromosome.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/AbstractListChromosome.java
index 15eda58..5b86416 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/AbstractListChromosome.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/AbstractListChromosome.java
@@ -29,7 +29,7 @@ import java.util.List;
  */
 public abstract class AbstractListChromosome<T> extends Chromosome {
 
-    /** List representing the chromosome */
+    /** List representing the chromosome. */
     private final List<T> representation;
 
     /**
@@ -96,7 +96,7 @@ public abstract class AbstractListChromosome<T> extends Chromosome {
      * @param chromosomeRepresentation the inner array representation of the new chromosome.
      * @return new instance extended from FixedLengthChromosome with the given arrayRepresentation
      */
-    public abstract AbstractListChromosome<T> newFixedLengthChromosome(final List<T> chromosomeRepresentation);
+    public abstract AbstractListChromosome<T> newFixedLengthChromosome(List<T> chromosomeRepresentation);
 
     /** {@inheritDoc} */
     @Override
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulation.java
index 1bb7822..59f5288 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulation.java
@@ -34,7 +34,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class ElitisticListPopulation extends ListPopulation {
 
-    /** percentage of chromosomes copied to the next generation */
+    /** percentage of chromosomes copied to the next generation. */
     private double elitismRate = 0.9;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/FixedGenerationCount.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/FixedGenerationCount.java
index a9fbc0a..bc8f595 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/FixedGenerationCount.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/FixedGenerationCount.java
@@ -28,10 +28,10 @@ import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
  * @since 2.0
  */
 public class FixedGenerationCount implements StoppingCondition {
-    /** Number of generations that have passed */
+    /** Number of generations that have passed. */
     private int numGenerations;
 
-    /** Maximum number of generations (stopping criteria) */
+    /** Maximum number of generations (stopping criteria). */
     private final int maxGenerations;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/InvalidRepresentationException.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/InvalidRepresentationException.java
index ffaffeb..6d2669c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/InvalidRepresentationException.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/InvalidRepresentationException.java
@@ -26,7 +26,7 @@ import org.apache.commons.math4.legacy.exception.util.Localizable;
  */
 public class InvalidRepresentationException extends MathIllegalArgumentException {
 
-    /** Serialization version id */
+    /** Serialization version id. */
     private static final long serialVersionUID = 1L;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ListPopulation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ListPopulation.java
index 5b40dbf..905dc8a 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ListPopulation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/ListPopulation.java
@@ -35,10 +35,10 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
  */
 public abstract class ListPopulation implements Population {
 
-    /** List of chromosomes */
+    /** List of chromosomes. */
     private final List<Chromosome> chromosomes;
 
-    /** maximal size of the population */
+    /** maximal size of the population. */
     private int populationLimit;
 
     /**
@@ -48,7 +48,7 @@ public abstract class ListPopulation implements Population {
      * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
      */
     public ListPopulation(final int populationLimit) throws NotPositiveException {
-        this(Collections.<Chromosome> emptyList(), populationLimit);
+        this(Collections.<Chromosome>emptyList(), populationLimit);
     }
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/TournamentSelection.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/TournamentSelection.java
index df36489..7374376 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/TournamentSelection.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/genetics/TournamentSelection.java
@@ -32,7 +32,7 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
  */
 public class TournamentSelection implements SelectionPolicy {
 
-    /** number of chromosomes included in the tournament selections */
+    /** number of chromosomes included in the tournament selections. */
     private int arity;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractFieldMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractFieldMatrix.java
index 8042345..7771742 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractFieldMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractFieldMatrix.java
@@ -46,14 +46,14 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>>
     private final Field<T> field;
 
     /**
-     * Constructor for use with Serializable
+     * Constructor for use with Serializable.
      */
     protected AbstractFieldMatrix() {
         field = null;
     }
 
     /**
-     * Creates a matrix with no data
+     * Creates a matrix with no data.
      * @param field field to which the elements belong
      */
     protected AbstractFieldMatrix(final Field<T> field) {
@@ -131,8 +131,8 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>>
 
     /** {@inheritDoc} */
     @Override
-    public abstract FieldMatrix<T> createMatrix(final int rowDimension,
-                                                final int columnDimension)
+    public abstract FieldMatrix<T> createMatrix(int rowDimension,
+                                                int columnDimension)
         throws NotStrictlyPositiveException;
 
     /** {@inheritDoc} */
@@ -987,7 +987,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>>
         if (object == this ) {
             return true;
         }
-        if (object instanceof FieldMatrix<?> == false) {
+        if (!(object instanceof FieldMatrix<?>)) {
             return false;
         }
         FieldMatrix<?> m = (FieldMatrix<?>) object;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractRealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractRealMatrix.java
index 264cbcb..23bacf2 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractRealMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/AbstractRealMatrix.java
@@ -49,7 +49,7 @@ public abstract class AbstractRealMatrix
     }
 
     /**
-     * Creates a matrix with no data
+     * Creates a matrix with no data.
      */
     protected AbstractRealMatrix() {}
 
@@ -958,7 +958,7 @@ public abstract class AbstractRealMatrix
         if (object == this ) {
             return true;
         }
-        if (object instanceof RealMatrix == false) {
+        if (!(object instanceof RealMatrix)) {
             return false;
         }
         RealMatrix m = (RealMatrix) object;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java
index 215ee16..f2ce22c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java
@@ -44,13 +44,13 @@ import org.apache.commons.math4.legacy.core.MathArrays;
 public class Array2DRowFieldMatrix<T extends FieldElement<T>>
     extends AbstractFieldMatrix<T>
     implements Serializable {
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 7260756672015356458L;
-    /** Entries of the matrix */
+    /** Entries of the matrix. */
     private T[][] data;
 
     /**
-     * Creates a matrix with no data
+     * Creates a matrix with no data.
      * @param field field to which the elements belong
      */
     public Array2DRowFieldMatrix(final Field<T> field) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java
index f57ec2b..65fe311 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java
@@ -40,7 +40,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
     private double data[][];
 
     /**
-     * Creates a matrix with no data
+     * Creates a matrix with no data.
      */
     public Array2DRowRealMatrix() {}
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java
index 8078544..ca33aeb 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigReal.java
@@ -50,10 +50,10 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
     /** Underlying BigDecimal. */
     private final BigDecimal d;
 
-    /** Rounding mode for divisions. **/
+    /** Rounding mode for divisions. */
     private RoundingMode roundingMode = RoundingMode.HALF_UP;
 
-    /*** BigDecimal scale ***/
+    /** BigDecimal scale. */
     private int scale = 64;
 
     /** Build an instance from a BigDecimal.
@@ -190,7 +190,7 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
     }
 
     /***
-     * Gets the rounding mode for division operations
+     * Gets the rounding mode for division operations.
      * The default is {@code RoundingMode.HALF_UP}
      * @return the rounding mode.
      * @since 2.1
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java
index cddfe68..1fcc868 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BigRealField.java
@@ -30,9 +30,9 @@ import org.apache.commons.math4.legacy.core.FieldElement;
  * @see BigReal
  * @since 2.0
  */
-public class BigRealField implements Field<BigReal>, Serializable  {
+public final class BigRealField implements Field<BigReal>, Serializable  {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 4756431066541037559L;
 
     /** Private constructor for the singleton.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BlockRealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BlockRealMatrix.java
index 3ccd94a..7c63518 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BlockRealMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/BlockRealMatrix.java
@@ -70,7 +70,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class BlockRealMatrix extends AbstractRealMatrix implements Serializable {
     /** Block size. */
     public static final int BLOCK_SIZE = 52;
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 4991895511313664478L;
     /** Blocks of matrix entries. */
     private final double blocks[][];
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/CholeskyDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/CholeskyDecomposition.java
index 262e2b9..1ad6322 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/CholeskyDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/CholeskyDecomposition.java
@@ -182,7 +182,7 @@ public class CholeskyDecomposition {
     }
 
     /**
-     * Return the determinant of the matrix
+     * Return the determinant of the matrix.
      * @return determinant of the matrix
      */
     public double getDeterminant() {
@@ -203,7 +203,7 @@ public class CholeskyDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
         /** Row-oriented storage for L<sup>T</sup> matrix data. */
         private final double[][] lTData;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/DecompositionSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/DecompositionSolver.java
index 6f0aa06..a23cda7 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/DecompositionSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/DecompositionSolver.java
@@ -46,7 +46,7 @@ public interface DecompositionSolver {
      * if the matrices dimensions do not match.
      * @throws SingularMatrixException if the decomposed matrix is singular.
      */
-    RealVector solve(final RealVector b) throws SingularMatrixException;
+    RealVector solve(RealVector b) throws SingularMatrixException;
 
     /**
      * Solve the linear equation A &times; X = B for matrices A.
@@ -60,7 +60,7 @@ public interface DecompositionSolver {
      * if the matrices dimensions do not match.
      * @throws SingularMatrixException if the decomposed matrix is singular.
      */
-    RealMatrix solve(final RealMatrix b) throws SingularMatrixException;
+    RealMatrix solve(RealMatrix b) throws SingularMatrixException;
 
     /**
      * Check if the decomposed matrix is non-singular.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/EigenDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/EigenDecomposition.java
index 3dbad74..1a07941 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/EigenDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/EigenDecomposition.java
@@ -79,7 +79,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class EigenDecomposition {
     /** Internally used epsilon criteria. */
     private static final double EPSILON = 1e-12;
-    /** Maximum number of iterations accepted in the implicit QL transformation */
+    /** Maximum number of iterations accepted in the implicit QL transformation. */
     private static final byte MAX_ITER = 30;
     /** Main diagonal of the tridiagonal matrix. */
     private double[] main;
@@ -377,7 +377,7 @@ public class EigenDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
         /** Real part of the realEigenvalues. */
         private final double[] realEigenvalues;
         /** Imaginary part of the realEigenvalues. */
@@ -556,7 +556,7 @@ public class EigenDecomposition {
     }
 
     /**
-     * Find eigenvalues and eigenvectors (Dubrulle et al., 1971)
+     * Find eigenvalues and eigenvectors (Dubrulle et al., 1971).
      *
      * @param householderMatrix Householder matrix of the transformation
      * to tridiagonal form.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldDecompositionSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldDecompositionSolver.java
index 7193bc1..d7dd680 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldDecompositionSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldDecompositionSolver.java
@@ -46,7 +46,7 @@ public interface FieldDecompositionSolver<T extends FieldElement<T>> {
      * @throws SingularMatrixException
      * if the decomposed matrix is singular.
      */
-    FieldVector<T> solve(final FieldVector<T> b);
+    FieldVector<T> solve(FieldVector<T> b);
 
     /** Solve the linear equation A &times; X = B for matrices A.
      * <p>The A matrix is implicit, it is provided by the underlying
@@ -58,7 +58,7 @@ public interface FieldDecompositionSolver<T extends FieldElement<T>> {
      * @throws SingularMatrixException
      * if the decomposed matrix is singular.
      */
-    FieldMatrix<T> solve(final FieldMatrix<T> b);
+    FieldMatrix<T> solve(FieldMatrix<T> b);
 
     /**
      * Check if the decomposed matrix is non-singular.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java
index 24e9531..17b0945 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java
@@ -259,7 +259,7 @@ public class FieldLUDecomposition<T extends FieldElement<T>> {
     /** Specialized solver.
      * @param <T> the type of the field elements
      */
-    private static class Solver<T extends FieldElement<T>> implements FieldDecompositionSolver<T> {
+    private static final class Solver<T extends FieldElement<T>> implements FieldDecompositionSolver<T> {
 
         /** Field to which the elements belong. */
         private final Field<T> field;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldMatrix.java
index c0d01ff..3bb739c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/FieldMatrix.java
@@ -55,7 +55,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
      * positive.
      * @since 2.0
      */
-    FieldMatrix<T> createMatrix(final int rowDimension, final int columnDimension)
+    FieldMatrix<T> createMatrix(int rowDimension, int columnDimension)
     throws NotStrictlyPositiveException;
 
     /**
@@ -132,7 +132,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
      * @throws NotPositiveException if {@code p < 0}
      * @throws NonSquareMatrixException if {@code this matrix} is not square
      */
-    FieldMatrix<T> power(final int p) throws NonSquareMatrixException,
+    FieldMatrix<T> power(int p) throws NonSquareMatrixException,
     NotPositiveException;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java
index 26e5d3e..2812ee4 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterationEvent.java
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.math4.legacy.linear;
 
-import org.apache.commons.math4.legacy.linear.IterationManager;
-
 import java.util.EventObject;
 
 /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java
index fd07c33..1486f65 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/IterativeLinearSolver.java
@@ -19,7 +19,6 @@ package org.apache.commons.math4.legacy.linear;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
 import org.apache.commons.math4.legacy.exception.MaxCountExceededException;
 import org.apache.commons.math4.legacy.exception.NullArgumentException;
-import org.apache.commons.math4.legacy.core.IntegerSequence;
 
 /**
  * This abstract class defines an iterative solver for the linear system A
@@ -112,7 +111,7 @@ public abstract class IterativeLinearSolver {
      * inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public RealVector solve(final RealLinearOperator a, final RealVector b)
@@ -138,7 +137,7 @@ public abstract class IterativeLinearSolver {
      * dimensions inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public RealVector solve(RealLinearOperator a, RealVector b, RealVector x0)
@@ -163,7 +162,7 @@ public abstract class IterativeLinearSolver {
      * dimensions inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public abstract RealVector solveInPlace(RealLinearOperator a, RealVector b,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/LUDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/LUDecomposition.java
index 9db7b66..6cfa36f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/LUDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/LUDecomposition.java
@@ -232,7 +232,7 @@ public class LUDecomposition {
     }
 
     /**
-     * Return the determinant of the matrix
+     * Return the determinant of the matrix.
      * @return determinant of the matrix
      */
     public double getDeterminant() {
@@ -258,7 +258,7 @@ public class LUDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
 
         /** Entries of LU decomposition. */
         private final double[][] lu;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/MatrixUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/MatrixUtils.java
index 5f78d4a..7504cac 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/MatrixUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/MatrixUtils.java
@@ -40,7 +40,7 @@ import org.apache.commons.numbers.core.Precision;
  * A collection of static methods that operate on or return matrices.
  *
  */
-public class MatrixUtils {
+public final class MatrixUtils {
 
     /**
      * The default format for {@link RealMatrix} objects.
@@ -582,7 +582,7 @@ public class MatrixUtils {
     }
 
     /**
-     * Check if matrices are subtraction compatible
+     * Check if matrices are subtraction compatible.
      *
      * @param left Left hand side matrix.
      * @param right Right hand side matrix.
@@ -594,7 +594,7 @@ public class MatrixUtils {
     }
 
     /**
-     * Check if matrices are multiplication compatible
+     * Check if matrices are multiplication compatible.
      *
      * @param left Left hand side matrix.
      * @param right Right hand side matrix.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java
index 6241230..f17886c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java
@@ -46,7 +46,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     /** Status indicator for removed table entries. */
     protected static final byte REMOVED = 2;
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = -3646337053166149105L;
 
     /** Load factor for the map. */
@@ -89,15 +89,15 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     /**
      * Build an empty map with default size and using NaN for missing entries.
      */
-    public OpenIntToDoubleHashMap() {
+    OpenIntToDoubleHashMap() {
         this(DEFAULT_EXPECTED_SIZE, Double.NaN);
     }
 
     /**
-     * Build an empty map with default size
+     * Build an empty map with default size.
      * @param missingEntries value to return when a missing entry is fetched
      */
-    public OpenIntToDoubleHashMap(final double missingEntries) {
+    OpenIntToDoubleHashMap(final double missingEntries) {
         this(DEFAULT_EXPECTED_SIZE, missingEntries);
     }
 
@@ -105,7 +105,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
      * Build an empty map with specified size and using NaN for missing entries.
      * @param expectedSize expected number of elements in the map
      */
-    public OpenIntToDoubleHashMap(final int expectedSize) {
+    OpenIntToDoubleHashMap(final int expectedSize) {
         this(expectedSize, Double.NaN);
     }
 
@@ -114,8 +114,8 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
      * @param expectedSize expected number of elements in the map
      * @param missingEntries value to return when a missing entry is fetched
      */
-    public OpenIntToDoubleHashMap(final int expectedSize,
-                                  final double missingEntries) {
+    OpenIntToDoubleHashMap(final int expectedSize,
+                           final double missingEntries) {
         final int capacity = computeCapacity(expectedSize);
         keys   = new int[capacity];
         values = new double[capacity];
@@ -128,7 +128,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
      * Copy constructor.
      * @param source map to copy
      */
-    public OpenIntToDoubleHashMap(final OpenIntToDoubleHashMap source) {
+    OpenIntToDoubleHashMap(final OpenIntToDoubleHashMap source) {
         final int length = source.keys.length;
         keys = new int[length];
         System.arraycopy(source.keys, 0, keys, 0, length);
@@ -160,7 +160,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Find the smallest power of two greater than the input value
+     * Find the smallest power of two greater than the input value.
      * @param i input value
      * @return smallest power of two greater than the input value
      */
@@ -169,7 +169,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Get the stored value associated with the given key
+     * Get the stored value associated with the given key.
      * @param key key associated with the data
      * @return data associated with the key
      */
@@ -249,7 +249,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Find the index at which a key should be inserted
+     * Find the index at which a key should be inserted.
      * @param key key to lookup
      * @return index at which key should be inserted
      */
@@ -258,7 +258,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Find the index at which a key should be inserted
+     * Find the index at which a key should be inserted.
      * @param keys keys table
      * @param states states table
      * @param key key to lookup
@@ -315,7 +315,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Compute next probe for collision resolution
+     * Compute next probe for collision resolution.
      * @param perturb perturbed hash
      * @param j previous probe
      * @return next probe
@@ -325,7 +325,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Change the index sign
+     * Change the index sign.
      * @param index initial index
      * @return changed index
      */
@@ -468,7 +468,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
     }
 
     /**
-     * Compute the hash value of a key
+     * Compute the hash value of a key.
      * @param key key to hash
      * @return hash value of the key
      */
@@ -479,7 +479,7 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
 
 
     /** Iterator class for the map. */
-    public class Iterator {
+    public final class Iterator {
 
         /** Reference modification count. */
         private final int referenceCount;
@@ -567,9 +567,9 @@ class OpenIntToDoubleHashMap implements Serializable { // Not in public API.
 
             // prepare next step
             try {
-                while (states[++next] != FULL) { // NOPMD
-                    // nothing to do
-                }
+                do {
+                    ++next;
+                } while (states[next] != FULL);
             } catch (ArrayIndexOutOfBoundsException e) {
                 next = -2;
                 if (current < 0) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java
index 348d3d8..2790370 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java
@@ -96,16 +96,16 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
      * Build an empty map with default size and using zero for missing entries.
      * @param field field to which the elements belong
      */
-    public OpenIntToFieldHashMap(final Field<T>field) {
+    OpenIntToFieldHashMap(final Field<T> field) {
         this(field, DEFAULT_EXPECTED_SIZE, field.getZero());
     }
 
     /**
-     * Build an empty map with default size
+     * Build an empty map with default size.
      * @param field field to which the elements belong
      * @param missingEntries value to return when a missing entry is fetched
      */
-    public OpenIntToFieldHashMap(final Field<T>field, final T missingEntries) {
+    OpenIntToFieldHashMap(final Field<T> field, final T missingEntries) {
         this(field,DEFAULT_EXPECTED_SIZE, missingEntries);
     }
 
@@ -114,7 +114,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
      * @param field field to which the elements belong
      * @param expectedSize expected number of elements in the map
      */
-    public OpenIntToFieldHashMap(final Field<T> field,final int expectedSize) {
+    OpenIntToFieldHashMap(final Field<T> field,final int expectedSize) {
         this(field,expectedSize, field.getZero());
     }
 
@@ -124,8 +124,8 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
      * @param expectedSize expected number of elements in the map
      * @param missingEntries value to return when a missing entry is fetched
      */
-    public OpenIntToFieldHashMap(final Field<T> field,final int expectedSize,
-                                  final T missingEntries) {
+    OpenIntToFieldHashMap(final Field<T> field,final int expectedSize,
+                          final T missingEntries) {
         this.field = field;
         final int capacity = computeCapacity(expectedSize);
         keys   = new int[capacity];
@@ -139,7 +139,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
      * Copy constructor.
      * @param source map to copy
      */
-    public OpenIntToFieldHashMap(final OpenIntToFieldHashMap<T> source) {
+    OpenIntToFieldHashMap(final OpenIntToFieldHashMap<T> source) {
         field = source.field;
         final int length = source.keys.length;
         keys = new int[length];
@@ -172,7 +172,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Find the smallest power of two greater than the input value
+     * Find the smallest power of two greater than the input value.
      * @param i input value
      * @return smallest power of two greater than the input value
      */
@@ -181,7 +181,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Get the stored value associated with the given key
+     * Get the stored value associated with the given key.
      * @param key key associated with the data
      * @return data associated with the key
      */
@@ -261,7 +261,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Find the index at which a key should be inserted
+     * Find the index at which a key should be inserted.
      * @param key key to lookup
      * @return index at which key should be inserted
      */
@@ -270,7 +270,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Find the index at which a key should be inserted
+     * Find the index at which a key should be inserted.
      * @param keys keys table
      * @param states states table
      * @param key key to lookup
@@ -327,7 +327,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Compute next probe for collision resolution
+     * Compute next probe for collision resolution.
      * @param perturb perturbed hash
      * @param j previous probe
      * @return next probe
@@ -337,7 +337,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Change the index sign
+     * Change the index sign.
      * @param index initial index
      * @return changed index
      */
@@ -480,7 +480,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
     }
 
     /**
-     * Compute the hash value of a key
+     * Compute the hash value of a key.
      * @param key key to hash
      * @return hash value of the key
      */
@@ -491,7 +491,7 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
 
 
     /** Iterator class for the map. */
-    public class Iterator {
+    public final class Iterator {
 
         /** Reference modification count. */
         private final int referenceCount;
@@ -579,9 +579,9 @@ class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
 
             // prepare next step
             try {
-                while (states[++next] != FULL) { // NOPMD
-                    // nothing to do
-                }
+                do {
+                    ++next;
+                } while (states[next] != FULL);
             } catch (ArrayIndexOutOfBoundsException e) {
                 next = -2;
                 if (current < 0) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java
index d35a3de..7ac52bf 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/OpenMapRealMatrix.java
@@ -294,7 +294,7 @@ public class OpenMapRealMatrix extends AbstractRealMatrix
     }
 
     /**
-     * Compute the key to access a matrix element
+     * Compute the key to access a matrix element.
      * @param row row index of the matrix element
      * @param column column index of the matrix element
      * @return key within the map to access the matrix element
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java
index 0c5502c..ca459c5 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/PreconditionedIterativeLinearSolver.java
@@ -19,21 +19,20 @@ package org.apache.commons.math4.legacy.linear;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
 import org.apache.commons.math4.legacy.exception.MaxCountExceededException;
 import org.apache.commons.math4.legacy.exception.NullArgumentException;
-import org.apache.commons.math4.legacy.core.IntegerSequence;
 
 /**
  * <p>
  * This abstract class defines preconditioned iterative solvers. When A is
  * ill-conditioned, instead of solving system A &middot; x = b directly, it is
  * preferable to solve either
- * <center>
+ * <pre>
  * (M &middot; A) &middot; x = M &middot; b
- * </center>
+ * </pre>
  * (left preconditioning), or
- * <center>
+ * <pre>
  * (A &middot; M) &middot; y = b, &nbsp;&nbsp;&nbsp;&nbsp;followed by
  * M &middot; y = x
- * </center>
+ * </pre>
  * (right preconditioning), where M approximates in some way A<sup>-1</sup>,
  * while matrix-vector products of the type M &middot; y remain comparatively
  * easy to compute. In this library, M (not M<sup>-1</sup>!) is called the
@@ -85,7 +84,7 @@ public abstract class PreconditionedIterativeLinearSolver
      * {@code x0} have dimensions inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public RealVector solve(final RealLinearOperator a,
@@ -166,7 +165,7 @@ public abstract class PreconditionedIterativeLinearSolver
      * dimensions inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public RealVector solve(RealLinearOperator a, RealLinearOperator m,
@@ -194,7 +193,7 @@ public abstract class PreconditionedIterativeLinearSolver
      * {@code x0} have dimensions inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      */
     public abstract RealVector solveInPlace(RealLinearOperator a,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/QRDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/QRDecomposition.java
index d44b3ec..f7a493b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/QRDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/QRDecomposition.java
@@ -309,7 +309,7 @@ public class QRDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
         /**
          * A packed TRANSPOSED representation of the QR decomposition.
          * <p>The elements BELOW the diagonal are the elements of the UPPER triangular
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RRQRDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RRQRDecomposition.java
index f3fd0af..40df29c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RRQRDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RRQRDecomposition.java
@@ -198,12 +198,12 @@ public class RRQRDecomposition extends QRDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
 
         /** Upper level solver. */
         private final DecompositionSolver upper;
 
-        /** A permutation matrix for the pivots used in the QR decomposition */
+        /** A permutation matrix for the pivots used in the QR decomposition. */
         private RealMatrix p;
 
         /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealLinearOperator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealLinearOperator.java
index 6e6d51b..2f5024d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealLinearOperator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealLinearOperator.java
@@ -72,7 +72,7 @@ public abstract class RealLinearOperator {
      * @throws DimensionMismatchException if the column dimension does not match
      * the size of {@code x}
      */
-    public abstract RealVector operate(final RealVector x)
+    public abstract RealVector operate(RealVector x)
         throws DimensionMismatchException;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealMatrix.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealMatrix.java
index abc3b7f..dc74f27 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealMatrix.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/RealMatrix.java
@@ -127,7 +127,7 @@ public interface RealMatrix extends AnyMatrix {
      * @throws NotPositiveException if {@code p < 0}
      * @throws NonSquareMatrixException if the matrix is not square
      */
-    RealMatrix power(final int p)
+    RealMatrix power(int p)
         throws NotPositiveException, NonSquareMatrixException;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SchurTransformer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SchurTransformer.java
index 0d5cbe8..2aa8273 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SchurTransformer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SchurTransformer.java
@@ -340,7 +340,7 @@ class SchurTransformer {
     }
 
     /**
-     * Perform a double QR step involving rows l:idx and columns m:n
+     * Perform a double QR step involving rows l:idx and columns m:n.
      *
      * @param il the index of the small sub-diagonal element
      * @param im the start index for the QR step
@@ -439,11 +439,11 @@ class SchurTransformer {
     private static class ShiftInfo {
         // CHECKSTYLE: stop all
 
-        /** x shift info */
+        /** x shift info. */
         double x;
-        /** y shift info */
+        /** y shift info. */
         double y;
-        /** w shift info */
+        /** w shift info. */
         double w;
         /** Indicates an exceptional shift. */
         double exShift;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SingularValueDecomposition.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SingularValueDecomposition.java
index e987381..fe8ea64 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SingularValueDecomposition.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SingularValueDecomposition.java
@@ -323,10 +323,11 @@ public class SingularValueDecomposition {
             }
             k++;
             // Perform the task indicated by kase.
+            double f;
             switch (kase) {
                 // Deflate negligible s(p).
-                case 1: {
-                    double f = e[p - 2];
+                case 1:
+                    f = e[p - 2];
                     e[p - 2] = 0;
                     for (int j = p - 2; j >= k; j--) {
                         double t = AccurateMath.hypot(singularValues[j], f);
@@ -344,11 +345,10 @@ public class SingularValueDecomposition {
                             V[i][j] = t;
                         }
                     }
-                }
-                break;
+                    break;
                 // Split at negligible s(k).
-                case 2: {
-                    double f = e[k - 1];
+                case 2:
+                    f = e[k - 1];
                     e[k - 1] = 0;
                     for (int j = k; j < p; j++) {
                         double t = AccurateMath.hypot(singularValues[j], f);
@@ -364,10 +364,9 @@ public class SingularValueDecomposition {
                             U[i][j] = t;
                         }
                     }
-                }
-                break;
+                    break;
                 // Perform one qr step.
-                case 3: {
+                case 3:
                     // Calculate the shift.
                     final double maxPm1Pm2 = AccurateMath.max(AccurateMath.abs(singularValues[p - 1]),
                                                           AccurateMath.abs(singularValues[p - 2]));
@@ -391,7 +390,7 @@ public class SingularValueDecomposition {
                         }
                         shift = c / (b + shift);
                     }
-                    double f = (sk + sp) * (sk - sp) + shift;
+                    f = (sk + sp) * (sk - sp) + shift;
                     double g = sk * ek;
                     // Chase zeros.
                     for (int j = k; j < p - 1; j++) {
@@ -428,10 +427,9 @@ public class SingularValueDecomposition {
                         }
                     }
                     e[p - 2] = f;
-                }
-                break;
+                    break;
                 // Convergence.
-                default: {
+                default:
                     // Make the singular values positive.
                     if (singularValues[k] <= 0) {
                         singularValues[k] = singularValues[k] < 0 ? -singularValues[k] : 0;
@@ -465,8 +463,7 @@ public class SingularValueDecomposition {
                         k++;
                     }
                     p--;
-                }
-                break;
+                    break;
             }
         }
 
@@ -654,7 +651,7 @@ public class SingularValueDecomposition {
     }
 
     /** Specialized solver. */
-    private static class Solver implements DecompositionSolver {
+    private static final class Solver implements DecompositionSolver {
         /** Pseudo-inverse of the initial matrix. */
         private final RealMatrix pseudoInverse;
         /** Singularity indicator. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java
index fd62ba6..14ebc0a 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SparseFieldVector.java
@@ -410,7 +410,7 @@ public class SparseFieldVector<T extends FieldElement<T>> implements FieldVector
             while (iter.hasNext()) {
                 iter.advance();
                 int row = iter.key();
-                FieldElement<T>value = iter.value();
+                FieldElement<T> value = iter.value();
                 for (int col = 0; col < n; col++) {
                     res.setEntry(row, col, value.multiply(v.getEntry(col)));
                 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java
index adea2e2..77880c1 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear/SymmLQ.java
@@ -21,7 +21,6 @@ import org.apache.commons.math4.legacy.exception.MaxCountExceededException;
 import org.apache.commons.math4.legacy.exception.NullArgumentException;
 import org.apache.commons.math4.legacy.exception.util.ExceptionContext;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
-import org.apache.commons.math4.legacy.core.IntegerSequence;
 
 /**
  * <p>
@@ -953,7 +952,7 @@ public class SymmLQ
      * inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is
      * {@code true}, and {@code a} or {@code m} is not self-adjoint
@@ -1041,7 +1040,7 @@ public class SymmLQ
      * inconsistent with {@code a}
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is
      * {@code true}, and {@code a} is not self-adjoint
@@ -1131,7 +1130,7 @@ public class SymmLQ
      * have dimensions inconsistent with {@code a}.
      * @throws MaxCountExceededException at exhaustion of the iteration count,
      * unless a custom
-     * {@link IntegerSequence.Incrementor.MaxCountExceededCallback callback}
+     * {@link org.apache.commons.math4.legacy.core.IntegerSequence.Incrementor.MaxCountExceededCallback callback}
      * has been set at construction of the {@link IterationManager}
      * @throws NonSelfAdjointOperatorException if {@link #getCheck()} is
      * {@code true}, and {@code a} or {@code m} is not self-adjoint
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
index 4fcdda4..eb9e1fc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/KMeansPlusPlusClusterer.java
@@ -226,7 +226,7 @@ public class KMeansPlusPlusClusterer<T extends Clusterable> extends Clusterer<T>
     }
 
     /**
-     * Adjust the clusters's centers with means of points
+     * Adjust the clusters's centers with means of points.
      * @param clusters the origin clusters
      * @return adjusted clusters with center points
      */
@@ -450,7 +450,7 @@ public class KMeansPlusPlusClusterer<T extends Clusterable> extends Clusterer<T>
     }
 
     /**
-     * Get a random point from the {@link Cluster} with the largest number of points
+     * Get a random point from the {@link Cluster} with the largest number of points.
      *
      * @param clusters the {@link Cluster}s to search
      * @return a random point from the selected cluster
@@ -484,7 +484,7 @@ public class KMeansPlusPlusClusterer<T extends Clusterable> extends Clusterer<T>
     }
 
     /**
-     * Get the point farthest to its cluster center
+     * Get the point farthest to its cluster center.
      *
      * @param clusters the {@link Cluster}s to search
      * @return point farthest to its cluster center
@@ -520,7 +520,7 @@ public class KMeansPlusPlusClusterer<T extends Clusterable> extends Clusterer<T>
     }
 
     /**
-     * Returns the nearest {@link Cluster} to the given point
+     * Returns the nearest {@link Cluster} to the given point.
      *
      * @param clusters the {@link Cluster}s to search
      * @param point the point to find the nearest {@link Cluster} for
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/MiniBatchKMeansClusterer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/MiniBatchKMeansClusterer.java
index 73ae3db..8a8d6e7 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/MiniBatchKMeansClusterer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/MiniBatchKMeansClusterer.java
@@ -239,7 +239,7 @@ public class MiniBatchKMeansClusterer<T extends Clusterable>
      * The evaluator checks whether improvement occurred during the
      * {@link #maxNoImprovementTimes allowed number of successive iterations}.
      */
-    private static class ImprovementEvaluator {
+    private static final class ImprovementEvaluator {
         /** Batch size. */
         private final int batchSize;
         /** Maximum number of iterations during which no improvement is occuring. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/evaluation/CalinskiHarabasz.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/evaluation/CalinskiHarabasz.java
index 5fab367..a4a360f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/evaluation/CalinskiHarabasz.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ml/clustering/evaluation/CalinskiHarabasz.java
@@ -153,7 +153,7 @@ public class CalinskiHarabasz implements ClusterEvaluator {
     }
 
     /**
-     * Detect the dimension of points in the clusters
+     * Detect the dimension of points in the clusters.
      *
      * @param clusters collection of cluster
      * @return The dimension of the first point in clusters
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/ContinuousOutputModel.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/ContinuousOutputModel.java
index 2acd4e1..4e29d22 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/ContinuousOutputModel.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/ContinuousOutputModel.java
@@ -89,7 +89,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class ContinuousOutputModel
   implements StepHandler, Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = -1417964919405031606L;
 
     /** Initial integration time. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/FirstOrderFieldIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/FirstOrderFieldIntegrator.java
index 5fa1677..d963b4a 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/FirstOrderFieldIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/FirstOrderFieldIntegrator.java
@@ -111,7 +111,7 @@ public interface FirstOrderFieldIntegrator<T extends RealFieldElement<T>> {
      * @see #addEventHandler(FieldEventHandler, double, double, int)
      * @see #clearEventHandlers()
      */
-    Collection<FieldEventHandler<T> > getEventHandlers();
+    Collection<FieldEventHandler<T>> getEventHandlers();
 
     /** Remove all the event handlers that have been added to the integrator.
      * @see #addEventHandler(FieldEventHandler, double, double, int)
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepFieldIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepFieldIntegrator.java
index f0c9e43..a25518d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepFieldIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepFieldIntegrator.java
@@ -262,9 +262,9 @@ public abstract class MultistepFieldIntegrator<T extends RealFieldElement<T>>
      * @return Nordieck vector at first step (h<sup>2</sup>/2 y''<sub>n</sub>,
      * h<sup>3</sup>/6 y'''<sub>n</sub> ... h<sup>k</sup>/k! y<sup>(k)</sup><sub>n</sub>)
      */
-    protected abstract Array2DRowFieldMatrix<T> initializeHighOrderDerivatives(final T h, final T[] t,
-                                                                               final T[][] y,
-                                                                               final T[][] yDot);
+    protected abstract Array2DRowFieldMatrix<T> initializeHighOrderDerivatives(T h, T[] t,
+                                                                               T[][] y,
+                                                                               T[][] yDot);
 
     /** Get the minimal reduction factor for stepsize control.
      * @return minimal reduction factor
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepIntegrator.java
index 378406b..222f663 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/MultistepIntegrator.java
@@ -273,9 +273,9 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
      * @return Nordieck vector at first step (h<sup>2</sup>/2 y''<sub>n</sub>,
      * h<sup>3</sup>/6 y'''<sub>n</sub> ... h<sup>k</sup>/k! y<sup>(k)</sup><sub>n</sub>)
      */
-    protected abstract Array2DRowRealMatrix initializeHighOrderDerivatives(final double h, final double[] t,
-                                                                           final double[][] y,
-                                                                           final double[][] yDot);
+    protected abstract Array2DRowRealMatrix initializeHighOrderDerivatives(double h, double[] t,
+                                                                           double[][] y,
+                                                                           double[][] yDot);
 
     /** Get the minimal reduction factor for stepsize control.
      * @return minimal reduction factor
@@ -347,9 +347,9 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
          * @return Nordieck vector at first step (h<sup>2</sup>/2 y''<sub>n</sub>,
          * h<sup>3</sup>/6 y'''<sub>n</sub> ... h<sup>k</sup>/k! y<sup>(k)</sup><sub>n</sub>)
          */
-        Array2DRowRealMatrix initializeHighOrderDerivatives(final double h, final double[] t,
-                                                            final double[][] y,
-                                                            final double[][] yDot);
+        Array2DRowRealMatrix initializeHighOrderDerivatives(double h, double[] t,
+                                                            double[][] y,
+                                                            double[][] yDot);
     }
 
     /** Specialized step handler storing the first step. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/SecondOrderIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/SecondOrderIntegrator.java
index 0c32176..80f64d9 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/SecondOrderIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/SecondOrderIntegrator.java
@@ -35,7 +35,7 @@ import org.apache.commons.math4.legacy.exception.MathIllegalStateException;
 
 public interface SecondOrderIntegrator extends ODEIntegrator {
 
-  /** Integrate the differential equations up to the given time
+  /** Integrate the differential equations up to the given time.
    * @param equations differential equations to integrate
    * @param t0 initial time
    * @param y0 initial value of the state vector at t0
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsFieldIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsFieldIntegrator.java
index aca29b1..89f0db3 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsFieldIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsFieldIntegrator.java
@@ -96,9 +96,9 @@ public abstract class AdamsFieldIntegrator<T extends RealFieldElement<T>> extend
 
     /** {@inheritDoc} */
     @Override
-    public abstract FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
-                                                            final FieldODEState<T> initialState,
-                                                            final T finalTime)
+    public abstract FieldODEStateAndDerivative<T> integrate(FieldExpandableODE<T> equations,
+                                                            FieldODEState<T> initialState,
+                                                            T finalTime)
         throws NumberIsTooSmallException, DimensionMismatchException,
                MaxCountExceededException, NoBracketingException;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsIntegrator.java
index dee7f3a..1b9488a 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsIntegrator.java
@@ -87,7 +87,7 @@ public abstract class AdamsIntegrator extends MultistepIntegrator {
 
     /** {@inheritDoc} */
     @Override
-    public abstract void integrate(final ExpandableStatefulODE equations, final double t)
+    public abstract void integrate(ExpandableStatefulODE equations, double t)
         throws NumberIsTooSmallException, DimensionMismatchException,
                MaxCountExceededException, NoBracketingException;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckFieldTransformer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckFieldTransformer.java
index 2f1194f..0541cd9 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckFieldTransformer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckFieldTransformer.java
@@ -130,7 +130,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  * @param <T> the type of the field elements
  * @since 3.6
  */
-public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
+public final class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
 
     /** Cache for already computed coefficients. */
     private static final Map<Integer,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckTransformer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckTransformer.java
index 3d73b42..d2ca84c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckTransformer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/AdamsNordsieckTransformer.java
@@ -128,7 +128,7 @@ import org.apache.commons.math4.legacy.field.linalg.FieldLUDecomposition;
  *
  * @since 2.0
  */
-public class AdamsNordsieckTransformer {
+public final class AdamsNordsieckTransformer {
 
     /** Cache for already computed coefficients. */
     private static final Map<Integer, AdamsNordsieckTransformer> CACHE =
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
index ecdf58c..2195e0e 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java
@@ -188,8 +188,8 @@ public abstract class EmbeddedRungeKuttaFieldIntegrator<T extends RealFieldEleme
      * @return external weights for the high order method from Butcher array
      */
     protected abstract RungeKuttaFieldStepInterpolator<T> createInterpolator(boolean forward, T[][] yDotK,
-                                                                             final FieldODEStateAndDerivative<T> globalPreviousState,
-                                                                             final FieldODEStateAndDerivative<T> globalCurrentState,
+                                                                             FieldODEStateAndDerivative<T> globalPreviousState,
+                                                                             FieldODEStateAndDerivative<T> globalCurrentState,
                                                                              FieldEquationsMapper<T> mapper);
     /** Get the order of the method.
      * @return order of the method
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/GraggBulirschStoerIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/GraggBulirschStoerIntegrator.java
index decfb26..e2b0a61 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/GraggBulirschStoerIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/GraggBulirschStoerIntegrator.java
@@ -654,7 +654,7 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator {
 
       // iterate over several substep sizes
       int k = -1;
-      for (boolean loop = true; loop; ) {
+      for (boolean loop = true; loop;) {
 
         ++k;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54StepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54StepInterpolator.java
index 03aebc0..61256ec 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54StepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54StepInterpolator.java
@@ -31,7 +31,7 @@ import org.apache.commons.math4.legacy.ode.sampling.StepInterpolator;
 class HighamHall54StepInterpolator
   extends RungeKuttaStepInterpolator {
 
-  /** Serializable version identifier */
+  /** Serializable version identifier. */
   private static final long serialVersionUID = 20111120L;
 
   /** Simple constructor.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolator.java
index caafb32..230f8e4 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherFieldStepInterpolator.java
@@ -68,7 +68,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
     /** -1372 - 847 q. */
     private final T d5b;
 
-    /** 2254 + 1029 q */
+    /** 2254 + 1029 q. */
     private final T d5c;
 
     /** 49 - 49 q. */
@@ -77,7 +77,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
     /** -1372 + 847 q. */
     private final T d6b;
 
-    /** 2254 - 1029 q */
+    /** 2254 - 1029 q. */
     private final T d6c;
 
     /** Simple constructor.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java
index 23e67c1..46b6ead 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java
@@ -34,7 +34,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 
 class LutherStepInterpolator extends RungeKuttaStepInterpolator {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20140416L;
 
     /** Square root. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointStepInterpolator.java
index b3d4531..a5b41e8 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/MidpointStepInterpolator.java
@@ -46,7 +46,7 @@ import org.apache.commons.math4.legacy.ode.sampling.StepInterpolator;
 class MidpointStepInterpolator
   extends RungeKuttaStepInterpolator {
 
-  /** Serializable version identifier */
+  /** Serializable version identifier. */
   private static final long serialVersionUID = 20111120L;
 
   /** Simple constructor.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java
index 58ba026..cb11eca 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java
@@ -105,8 +105,8 @@ public abstract class RungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
      * @return external weights for the high order method from Butcher array
      */
     protected abstract RungeKuttaFieldStepInterpolator<T> createInterpolator(boolean forward, T[][] yDotK,
-                                                                             final FieldODEStateAndDerivative<T> globalPreviousState,
-                                                                             final FieldODEStateAndDerivative<T> globalCurrentState,
+                                                                             FieldODEStateAndDerivative<T> globalPreviousState,
+                                                                             FieldODEStateAndDerivative<T> globalCurrentState,
                                                                              FieldEquationsMapper<T> mapper);
 
     /** {@inheritDoc} */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaStepInterpolator.java
index 48752c6..0a26c99 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaStepInterpolator.java
@@ -40,7 +40,7 @@ abstract class RungeKuttaStepInterpolator
     /** Previous state. */
     protected double[] previousState;
 
-    /** Slopes at the intermediate points */
+    /** Slopes at the intermediate points. */
     protected double[][] yDotK;
 
     /** Reference to the integrator. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java
index 5cee8f1..67875da 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java
@@ -56,7 +56,7 @@ import org.apache.commons.math4.legacy.ode.sampling.StepInterpolator;
 class ThreeEighthesStepInterpolator
   extends RungeKuttaStepInterpolator {
 
-  /** Serializable version identifier */
+  /** Serializable version identifier. */
   private static final long serialVersionUID = 20111120L;
 
   /** Simple constructor.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/AbstractStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/AbstractStepInterpolator.java
index 2680382..e4c5cc6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/AbstractStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/AbstractStepInterpolator.java
@@ -43,43 +43,43 @@ import org.apache.commons.math4.legacy.ode.EquationsMapper;
 public abstract class AbstractStepInterpolator
   implements StepInterpolator {
 
-  /** current time step */
+  /** current time step. */
   protected double h;
 
-  /** current state */
+  /** current state. */
   protected double[] currentState;
 
-  /** interpolated time */
+  /** interpolated time. */
   protected double interpolatedTime;
 
-  /** interpolated state */
+  /** interpolated state. */
   protected double[] interpolatedState;
 
-  /** interpolated derivatives */
+  /** interpolated derivatives. */
   protected double[] interpolatedDerivatives;
 
-  /** interpolated primary state */
+  /** interpolated primary state. */
   protected double[] interpolatedPrimaryState;
 
-  /** interpolated primary derivatives */
+  /** interpolated primary derivatives. */
   protected double[] interpolatedPrimaryDerivatives;
 
-  /** interpolated secondary state */
+  /** interpolated secondary state. */
   protected double[][] interpolatedSecondaryState;
 
-  /** interpolated secondary derivatives */
+  /** interpolated secondary derivatives. */
   protected double[][] interpolatedSecondaryDerivatives;
 
-  /** global previous time */
+  /** global previous time. */
   private double globalPreviousTime;
 
-  /** global current time */
+  /** global current time. */
   private double globalCurrentTime;
 
-  /** soft previous time */
+  /** soft previous time. */
   private double softPreviousTime;
 
-  /** soft current time */
+  /** soft current time. */
   private double softCurrentTime;
 
   /** indicate if the step has been finalized or not. */
@@ -235,7 +235,7 @@ public abstract class AbstractStepInterpolator
       }
   }
 
-  /** Reinitialize the instance
+  /** Reinitialize the instance.
    * @param y reference to the integrator array holding the state at the end of the step
    * @param isForward integration direction indicator
    * @param primary equations mapper for the primary equations set
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/DummyStepHandler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/DummyStepHandler.java
index e6fa985..0ac4c68 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/DummyStepHandler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/DummyStepHandler.java
@@ -33,7 +33,7 @@ package org.apache.commons.math4.legacy.ode.sampling;
  * @since 1.2
  */
 
-public class DummyStepHandler implements StepHandler {
+public final class DummyStepHandler implements StepHandler {
 
     /** Private constructor.
      * The constructor is private to prevent users from creating
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldFixedStepHandler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldFixedStepHandler.java
index 4fbdbe6..1fa8d34 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldFixedStepHandler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldFixedStepHandler.java
@@ -54,7 +54,7 @@ public interface FieldFixedStepHandler<T extends RealFieldElement<T>> {
     void init(FieldODEStateAndDerivative<T> initialState, T finalTime);
 
     /**
-     * Handle the last accepted step
+     * Handle the last accepted step.
      * @param state current value of the independent <i>time</i> variable,
      * state vector and derivative
      * For efficiency purposes, the {@link FieldStepNormalizer} class reuses
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepHandler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepHandler.java
index c233bea..4b85489 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepHandler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepHandler.java
@@ -54,7 +54,7 @@ public interface FieldStepHandler<T extends RealFieldElement<T>> {
     void init(FieldODEStateAndDerivative<T> initialState, T finalTime);
 
     /**
-     * Handle the last accepted step
+     * Handle the last accepted step.
      * @param interpolator interpolator for the last accepted step. For
      * efficiency purposes, the various integrators reuse the same
      * object on each call, so if the instance wants to keep it across
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepNormalizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepNormalizer.java
index a5d3aee..d97ee34 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepNormalizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FieldStepNormalizer.java
@@ -179,7 +179,7 @@ public class FieldStepNormalizer<T extends RealFieldElement<T>> implements Field
     }
 
     /**
-     * Handle the last accepted step
+     * Handle the last accepted step.
      * @param interpolator interpolator for the last accepted step. For
      * efficiency purposes, the various integrators reuse the same
      * object on each call, so if the instance wants to keep it across
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FixedStepHandler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FixedStepHandler.java
index 76bcb3a..ec23714 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FixedStepHandler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/FixedStepHandler.java
@@ -51,7 +51,7 @@ public interface FixedStepHandler  {
   void init(double t0, double[] y0, double t);
 
   /**
-   * Handle the last accepted step
+   * Handle the last accepted step.
    * @param t time of the current step
    * @param y state vector at t. For efficiency purposes, the {@link
    * StepNormalizer} class reuses the same array on each call, so if
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/NordsieckStepInterpolator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/NordsieckStepInterpolator.java
index 034436c..1faffa2 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/NordsieckStepInterpolator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/NordsieckStepInterpolator.java
@@ -40,7 +40,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 
 public class NordsieckStepInterpolator extends AbstractStepInterpolator {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = -7179861704951334960L;
 
     /** State variation. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepHandler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepHandler.java
index c448f96..e4c8ea1 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepHandler.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepHandler.java
@@ -54,7 +54,7 @@ public interface StepHandler {
     void init(double t0, double[] y0, double t);
 
     /**
-     * Handle the last accepted step
+     * Handle the last accepted step.
      * @param interpolator interpolator for the last accepted step. For
      * efficiency purposes, the various integrators reuse the same
      * object on each call, so if the instance wants to keep it across
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepNormalizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepNormalizer.java
index 1a65517..6d58d61 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepNormalizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/ode/sampling/StepNormalizer.java
@@ -186,7 +186,7 @@ public class StepNormalizer implements StepHandler {
     }
 
     /**
-     * Handle the last accepted step
+     * Handle the last accepted step.
      * @param interpolator interpolator for the last accepted step. For
      * efficiency purposes, the various integrators reuse the same
      * object on each call, so if the instance wants to keep it across
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/AbstractOptimizationProblem.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/AbstractOptimizationProblem.java
index aeb2540..6ed86dc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/AbstractOptimizationProblem.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/AbstractOptimizationProblem.java
@@ -36,9 +36,9 @@ public abstract class AbstractOptimizationProblem<PAIR>
     /** Callback to use for the iteration counter. */
     private static final MaxIterCallback MAX_ITER_CALLBACK = new MaxIterCallback();
 
-    /** max evaluations */
+    /** max evaluations. */
     private final int maxEvaluations;
-    /** max iterations */
+    /** max iterations. */
     private final int maxIterations;
     /** Convergence checker. */
     private final ConvergenceChecker<PAIR> checker;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
index d157b03..02c3d06 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/linear/SimplexTableau.java
@@ -77,17 +77,17 @@ class SimplexTableau implements Serializable {
     /** Serializable version identifier. */
     private static final long serialVersionUID = -1369660067587938365L;
 
-    /** bit mask for IEEE double exponent **/
+    /** bit mask for IEEE double exponent. */
     private static final long EXPN = 0x7ff0000000000000L;
-    /** bit mask for IEEE double mantissa and sign **/
+    /** bit mask for IEEE double mantissa and sign. */
     private static final long FRAC = 0x800fffffffffffffL;
-    /** max IEEE exponent is 2047 **/
+    /** max IEEE exponent is 2047. */
     private static final int MAX_IEEE_EXP = 2047;
-    /** min IEEE exponent is 0 **/
+    /** min IEEE exponent is 0. */
     private static final int MIN_IEEE_EXP = 0;
-    /** IEEE exponent is kept in an offset form, 1023 is zero **/
+    /** IEEE exponent is kept in an offset form, 1023 is zero. */
     private static final int OFFSET_IEEE_EXP = 1023;
-    /** double exponent shift per IEEE standard **/
+    /** double exponent shift per IEEE standard. */
     private static final int IEEE_EXPONENT_SHIFT = 52;
 
     /** Linear objective function. */
@@ -99,7 +99,7 @@ class SimplexTableau implements Serializable {
     /** Whether to restrict the variables to non-negative values. */
     private final boolean restrictToNonNegative;
 
-    /** The variables each column represents */
+    /** The variables each column represents. */
     private final List<String> columnLabels = new ArrayList<>();
 
     /** Simple tableau. */
@@ -126,7 +126,7 @@ class SimplexTableau implements Serializable {
     /** Maps rows to their corresponding basic variables. */
     private int[] basicRows;
 
-    /** changes in floating point exponent to scale the input */
+    /** changes in floating point exponent to scale the input. */
     private int[] variableExpChange;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
index 260185b..50eaaa6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/MultiStartMultivariateOptimizer.java
@@ -22,8 +22,6 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.function.Supplier;
 
-import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException;
-import org.apache.commons.math4.legacy.exception.NullArgumentException;
 import org.apache.commons.math4.legacy.optim.BaseMultiStartMultivariateOptimizer;
 import org.apache.commons.math4.legacy.optim.PointValuePair;
 
@@ -51,9 +49,9 @@ public class MultiStartMultivariateOptimizer
      * If {@code starts == 1}, the result will be same as if {@code optimizer}
      * is called directly.
      * @param generator Generator to use for restarts.
-     * @throws NullArgumentException if {@code optimizer} or {@code generator}
+     * @throws org.apache.commons.math4.legacy.exception.NullArgumentException NullArgumentException if {@code optimizer} or {@code generator}
      * is {@code null}.
-     * @throws NotStrictlyPositiveException if {@code starts < 1}.
+     * @throws org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException NotStrictlyPositiveException if {@code starts < 1}.
      */
     public MultiStartMultivariateOptimizer(final MultivariateOptimizer optimizer,
                                            final int starts,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/AbstractSimplex.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/AbstractSimplex.java
index e1c2f0e..bd1d555 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/AbstractSimplex.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/AbstractSimplex.java
@@ -202,8 +202,8 @@ public abstract class AbstractSimplex implements OptimizationData {
      * @throws org.apache.commons.math4.legacy.exception.TooManyEvaluationsException
      * if the algorithm fails to converge.
      */
-    public abstract void iterate(final MultivariateFunction evaluationFunction,
-                                 final Comparator<PointValuePair> comparator);
+    public abstract void iterate(MultivariateFunction evaluationFunction,
+                                 Comparator<PointValuePair> comparator);
 
     /**
      * Build an initial simplex.
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java
index 888a441..4b2ad12 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java
@@ -48,11 +48,11 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class BOBYQAOptimizer
     extends MultivariateOptimizer {
-    /** Minimum dimension of the problem: {@value} */
+    /** Minimum dimension of the problem: {@value}. */
     public static final int MINIMUM_PROBLEM_DIMENSION = 2;
-    /** Default value for {@link #initialTrustRegionRadius}: {@value} . */
+    /** Default value for {@link #initialTrustRegionRadius}: {@value}. */
     public static final double DEFAULT_INITIAL_RADIUS = 10.0;
-    /** Default value for {@link #stoppingTrustRegionRadius}: {@value} . */
+    /** Default value for {@link #stoppingTrustRegionRadius}: {@value}. */
     public static final double DEFAULT_STOPPING_RADIUS = 1E-8;
     /** Constant 0. */
     private static final double ZERO = 0d;
@@ -80,15 +80,15 @@ public class BOBYQAOptimizer
     private static final double ONE_OVER_A_THOUSAND = ONE / 1000;
 
     /**
-     * numberOfInterpolationPoints XXX
+     * numberOfInterpolationPoints XXX.
      */
     private final int numberOfInterpolationPoints;
     /**
-     * initialTrustRegionRadius XXX
+     * initialTrustRegionRadius XXX.
      */
     private double initialTrustRegionRadius;
     /**
-     * stoppingTrustRegionRadius XXX
+     * stoppingTrustRegionRadius XXX.
      */
     private final double stoppingTrustRegionRadius;
     /** Goal type (minimize or maximize). */
@@ -1262,6 +1262,7 @@ public class BOBYQAOptimizer
      *     KNEW-th column of the H matrix.
      * @param knew
      * @param adelt
+     * @return { alpha, cauchy }
      */
     private double[] altmov(
             int knew,
@@ -1806,6 +1807,7 @@ public class BOBYQAOptimizer
      * @param s
      * @param hs
      * @param hred
+     * @return { dsq, crvmin }
      */
     private double[] trsbox(
             double delta,
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
index 79ee03e..38f7919 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
@@ -107,7 +107,7 @@ public class CMAESOptimizer
      * @see Sigma
      */
     private double[] inputSigma;
-    /** Number of objective variables/problem dimension */
+    /** Number of objective variables/problem dimension. */
     private int dimension;
     /**
      * Defines the number of initial iterations, where the covariance matrix
@@ -118,7 +118,7 @@ public class CMAESOptimizer
      * @see <a href="http://hal.archives-ouvertes.fr/inria-00287367/en">A Simple Modification in CMA-ES</a>
      */
     private int diagonalOnly;
-    /** Number of objective variables/problem dimension */
+    /** Number of objective variables/problem dimension. */
     private boolean isMinimize = true;
     /** Indicates whether statistic data is collected. */
     private final boolean generateStatistics;
@@ -158,13 +158,13 @@ public class CMAESOptimizer
     private double damps;
     /** Learning rate for rank-one update. */
     private double ccov1;
-    /** Learning rate for rank-mu update' */
+    /** Learning rate for rank-mu update'. */
     private double ccovmu;
     /** Expectation of ||N(0,I)|| == norm(randn(N,1)). */
     private double chiN;
-    /** Learning rate for rank-one update - diagonalOnly */
+    /** Learning rate for rank-one update - diagonalOnly. */
     private double ccov1Sep;
-    /** Learning rate for rank-mu update - diagonalOnly */
+    /** Learning rate for rank-mu update - diagonalOnly. */
     private double ccovmuSep;
 
     // CMA internal values - updated each generation
@@ -386,7 +386,6 @@ public class CMAESOptimizer
         PointValuePair lastResult = null;
 
         // -------------------- Generation Loop --------------------------------
-
         generationLoop:
         for (iterations = 1; iterations <= maxIterations; iterations++) {
             incrementIterationCount();
@@ -421,13 +420,11 @@ public class CMAESOptimizer
                     break generationLoop;
                 }
             }
-
             // Compute fitnesses by adding value and penalty after scaling by value range.
             double valueRange = valueRange(valuePenaltyPairs);
             for (int iValue=0;iValue<valuePenaltyPairs.length;iValue++) {
                  fitness[iValue] = valuePenaltyPairs[iValue].value + valuePenaltyPairs[iValue].penalty*valueRange;
             }
-
             // Sort by fitness and compute weighted mean into xmean
             final int[] arindex = sortedIndices(fitness);
             // Calculate new xmean, this is selection and recombination
@@ -576,7 +573,7 @@ public class CMAESOptimizer
     }
 
     /**
-     * Initialization of the dynamic search parameters
+     * Initialization of the dynamic search parameters.
      *
      * @param guess Initial guess for the arguments of the fitness function.
      */
@@ -670,7 +667,7 @@ public class CMAESOptimizer
     }
 
     /**
-     * Update of the covariance matrix C for diagonalOnly > 0
+     * Update of the covariance matrix C for diagonalOnly > 0.
      *
      * @param hsig Flag indicating a small correction.
      * @param bestArz Fitness-sorted matrix of the gaussian random values of the
@@ -747,7 +744,7 @@ public class CMAESOptimizer
                 }
                 arzneg = times(arzneg, repmat(arnormsInv, dimension, 1));
                 final RealMatrix artmp = BD.multiply(arzneg);
-                final RealMatrix Cneg = artmp.multiply(diag(weights)).multiply(artmp.transpose());
+                final RealMatrix cNeg = artmp.multiply(diag(weights)).multiply(artmp.transpose());
                 oldFac += negalphaold * negccov;
                 C = C.scalarMultiply(oldFac)
                     .add(roneu) // regard old matrix
@@ -755,7 +752,7 @@ public class CMAESOptimizer
                                               ccovmu + (1 - negalphaold) * negccov) // plus rank mu update
                          .multiply(times(repmat(weights, 1, dimension),
                                          arpos.transpose())))
-                    .subtract(Cneg.scalarMultiply(negccov));
+                    .subtract(cNeg.scalarMultiply(negccov));
             } else {
                 // Adapt covariance matrix C - nonactive
                 C = C.scalarMultiply(oldFac) // regard old matrix
@@ -929,7 +926,7 @@ public class CMAESOptimizer
     private class FitnessFunction {
         /**
          * Flag indicating whether the objective variables are forced into their
-         * bounds if defined
+         * bounds if defined.
          */
         private final boolean isRepairMode;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
index ff620b9..8a17561 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/HaltonSequenceGenerator.java
@@ -19,7 +19,6 @@ package org.apache.commons.math4.legacy.random;
 import java.util.function.Supplier;
 
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
-import org.apache.commons.math4.legacy.exception.NotPositiveException;
 import org.apache.commons.math4.legacy.exception.NullArgumentException;
 import org.apache.commons.math4.legacy.exception.OutOfRangeException;
 
@@ -163,7 +162,7 @@ public class HaltonSequenceGenerator implements Supplier<double[]> {
      *
      * @param index the index in the sequence to skip to
      * @return the i-th point in the Halton sequence
-     * @throws NotPositiveException if index &lt; 0
+     * @throws org.apache.commons.math4.legacy.exception.NotPositiveException NotPositiveException if index &lt; 0
      */
     public double[] skipTo(final int index) {
         count = index;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RandomUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RandomUtils.java
index 48d2464..775693c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RandomUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/RandomUtils.java
@@ -17,13 +17,6 @@
 
 package org.apache.commons.math4.legacy.random;
 
-import java.util.Random;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import org.apache.commons.math4.legacy.exception.MathInternalError;
-import org.apache.commons.math4.legacy.exception.NotANumberException;
-import org.apache.commons.math4.legacy.exception.NotFiniteNumberException;
-import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException;
 import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException;
 import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
 import org.apache.commons.rng.UniformRandomProvider;
@@ -33,7 +26,7 @@ import org.apache.commons.rng.UniformRandomProvider;
  *
  * @since 4.0
  */
-public class RandomUtils {
+public final class RandomUtils {
     /**
      * Class contains only static methods.
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/SobolSequenceGenerator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/SobolSequenceGenerator.java
index c13c272..8269eec 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/SobolSequenceGenerator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/SobolSequenceGenerator.java
@@ -28,7 +28,6 @@ import java.util.function.Supplier;
 
 import org.apache.commons.math4.legacy.exception.MathInternalError;
 import org.apache.commons.math4.legacy.exception.MathParseException;
-import org.apache.commons.math4.legacy.exception.NotPositiveException;
 import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException;
 import org.apache.commons.math4.legacy.exception.OutOfRangeException;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
@@ -186,7 +185,7 @@ public class SobolSequenceGenerator implements Supplier<double[]> {
     private int initFromStream(final InputStream is) throws IOException {
         // special case: dimension 1 -> use unit initialization
         for (int i = 1; i <= BITS; i++) {
-            direction[0][i] = 1l << (BITS - i);
+            direction[0][i] = 1L << (BITS - i);
         }
 
         final Charset charset = Charset.forName(FILE_CHARSET);
@@ -283,7 +282,7 @@ public class SobolSequenceGenerator implements Supplier<double[]> {
      *
      * @param index the index in the sequence to skip to
      * @return the i-th point in the Sobol sequence
-     * @throws NotPositiveException if index &lt; 0
+     * @throws org.apache.commons.math4.legacy.exception.NotPositiveException NotPositiveException if index &lt; 0
      */
     public double[] skipTo(final int index) {
         if (index == 0) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/StableRandomGenerator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/StableRandomGenerator.java
index a842544..cfb6b4f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/StableRandomGenerator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/random/StableRandomGenerator.java
@@ -35,11 +35,11 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class StableRandomGenerator implements NormalizedRandomGenerator {
     /** Underlying generator. */
     private final UniformRandomProvider generator;
-    /** stability parameter */
+    /** stability parameter. */
     private final double alpha;
-    /** skewness parameter */
+    /** skewness parameter. */
     private final double beta;
-    /** cache of expression value used in generation */
+    /** cache of expression value used in generation. */
     private final double zeta;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/special/BesselJ.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/special/BesselJ.java
index 7972f12..1356986 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/special/BesselJ.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/special/BesselJ.java
@@ -61,16 +61,16 @@ public class BesselJ
     // Mathematical constants
     // ---------------------------------------------------------------------
 
-    /** -2 / pi */
+    /** -2 / pi. */
     private static final double PI2 = 0.636619772367581343075535;
 
-    /** first few significant digits of 2pi */
+    /** first few significant digits of 2pi. */
     private static final double TOWPI1 = 6.28125;
 
-    /** 2pi - TWOPI1 to working precision */
+    /** 2pi - TWOPI1 to working precision. */
     private static final double TWOPI2 = 1.935307179586476925286767e-3;
 
-    /** TOWPI1 + TWOPI2 */
+    /** TOWPI1 + TWOPI2. */
     private static final double TWOPI = TOWPI1 + TWOPI2;
 
     // ---------------------------------------------------------------------
@@ -79,7 +79,7 @@ public class BesselJ
 
     /**
      * 10.0^K, where K is the largest integer such that ENTEN is
-     * machine-representable in working precision
+     * machine-representable in working precision.
      */
     private static final double ENTEN = 1.0e308;
 
@@ -92,13 +92,13 @@ public class BesselJ
      */
     private static final double ENSIG = 1.0e16;
 
-    /** 10.0 ** (-K) for the smallest integer K such that K >= NSIG/4 */
+    /** 10.0 ** (-K) for the smallest integer K such that K >= NSIG/4. */
     private static final double RTNSIG = 1.0e-4;
 
-    /** Smallest ABS(X) such that X/4 does not underflow */
+    /** Smallest ABS(X) such that X/4 does not underflow. */
     private static final double ENMTEN = 8.90e-308;
 
-    /** Minimum acceptable value for x */
+    /** Minimum acceptable value for x. */
     private static final double X_MIN = 0.0;
 
     /**
@@ -108,7 +108,7 @@ public class BesselJ
      */
     private static final double X_MAX = 1.0e4;
 
-    /** First 25 factorials as doubles */
+    /** First 25 factorials as doubles. */
     private static final double[] FACT = {
         1.0, 1.0, 2.0, 6.0, 24.0, 120.0, 720.0, 5040.0, 40320.0, 362880.0,
         3628800.0, 39916800.0, 479001600.0, 6227020800.0, 87178291200.0,
@@ -118,7 +118,7 @@ public class BesselJ
         6.2044840173323943936e23
     };
 
-    /** Order of the function computed when {@link #value(double)} is used */
+    /** Order of the function computed when {@link #value(double)} is used. */
     private final double order;
 
     /**
@@ -192,10 +192,10 @@ public class BesselJ
      */
     public static class BesselJResult {
 
-        /** Bessel function values */
+        /** Bessel function values. */
         private final double[] vals;
 
-        /** Valid value count */
+        /** Valid value count. */
         private final int nVals;
 
         /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/Frequency.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/Frequency.java
index cfa9f7e..5b9f510 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/Frequency.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/Frequency.java
@@ -41,9 +41,9 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
  */
 public class Frequency<T extends Comparable<T>> implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 605878194679954450L;
-    /** underlying collection */
+    /** underlying collection. */
     private final SortedMap<T, Long> freqTable;
 
     /**
@@ -112,7 +112,7 @@ public class Frequency<T extends Comparable<T>> implements Serializable {
         }
     }
 
-    /** Clears the frequency table */
+    /** Clears the frequency table. */
     public void clear() {
         freqTable.clear();
     }
@@ -336,7 +336,7 @@ public class Frequency<T extends Comparable<T>> implements Serializable {
      */
     private static class NaturalComparator<U extends Comparable<U>> implements Comparator<U>, Serializable {
 
-        /** Serializable version identifier */
+        /** Serializable version identifier. */
         private static final long serialVersionUID = -3852193713161395148L;
 
         /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/StatUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/StatUtils.java
index 43d29ad..33e0245 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/StatUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/StatUtils.java
@@ -44,38 +44,38 @@ import org.apache.commons.math4.legacy.stat.descriptive.summary.SumOfSquares;
  */
 public final class StatUtils {
 
-    /** sum */
+    /** sum. */
     private static final UnivariateStatistic SUM = new Sum();
 
-    /** sumSq */
+    /** sumSq. */
     private static final UnivariateStatistic SUM_OF_SQUARES = new SumOfSquares();
 
-    /** prod */
+    /** prod. */
     private static final UnivariateStatistic PRODUCT = new Product();
 
-    /** sumLog */
+    /** sumLog. */
     private static final UnivariateStatistic SUM_OF_LOGS = new SumOfLogs();
 
-    /** min */
+    /** min. */
     private static final UnivariateStatistic MIN = new Min();
 
-    /** max */
+    /** max. */
     private static final UnivariateStatistic MAX = new Max();
 
-    /** mean */
+    /** mean. */
     private static final UnivariateStatistic MEAN = new Mean();
 
-    /** variance */
+    /** variance. */
     private static final Variance VARIANCE = new Variance();
 
-    /** percentile */
+    /** percentile. */
     private static final Percentile PERCENTILE = new Percentile();
 
-    /** geometric mean */
+    /** geometric mean. */
     private static final GeometricMean GEOMETRIC_MEAN = new GeometricMean();
 
     /**
-     * Private Constructor
+     * Private Constructor.
      */
     private StatUtils() {
     }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/Covariance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/Covariance.java
index 89d4132..a78a525 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/Covariance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/Covariance.java
@@ -44,13 +44,13 @@ import org.apache.commons.math4.legacy.stat.descriptive.moment.Variance;
  * @since 2.0
  */
 public class Covariance {
-    /** covariance matrix */
+    /** covariance matrix. */
     private final RealMatrix covarianceMatrix;
-    /** Number of observations (length of covariate vectors) */
+    /** Number of observations (length of covariate vectors). */
     private final int n;
 
     /**
-     * Create a Covariance with no data
+     * Create a Covariance with no data.
      */
     public Covariance() {
         super();
@@ -134,7 +134,7 @@ public class Covariance {
     }
 
     /**
-     * Returns the covariance matrix
+     * Returns the covariance matrix.
      *
      * @return covariance matrix
      */
@@ -143,7 +143,7 @@ public class Covariance {
     }
 
     /**
-     * Returns the number of observations (length of covariate vectors)
+     * Returns the number of observations (length of covariate vectors).
      *
      * @return number of observations
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/KendallsCorrelation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/KendallsCorrelation.java
index ecc126d..24bc4ef 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/KendallsCorrelation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/KendallsCorrelation.java
@@ -69,7 +69,7 @@ import org.apache.commons.math4.legacy.core.Pair;
  */
 public class KendallsCorrelation {
 
-    /** correlation matrix */
+    /** correlation matrix. */
     private final RealMatrix correlationMatrix;
 
     /**
@@ -268,6 +268,6 @@ public class KendallsCorrelation {
      * @return the sum of the number from 1 to n
      */
     private static long sum(long n) {
-        return n * (n + 1) / 2l;
+        return n * (n + 1) / 2L;
     }
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/PearsonsCorrelation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/PearsonsCorrelation.java
index dc68e48..34c2f6d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/PearsonsCorrelation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/PearsonsCorrelation.java
@@ -50,10 +50,10 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class PearsonsCorrelation {
 
-    /** correlation matrix */
+    /** correlation matrix. */
     private final RealMatrix correlationMatrix;
 
-    /** number of observations */
+    /** number of observations. */
     private final int nObs;
 
     /**
@@ -157,7 +157,7 @@ public class PearsonsCorrelation {
      * matrix must have been used to create this instance.</p>
      *
      * @return matrix of correlation standard errors
-     * @throws NullPointerException if this instance was created with no data
+     * @throws NullPointerException if this instance was created with no data.
      */
     public RealMatrix getCorrelationStandardErrors() {
         int nVars = correlationMatrix.getColumnDimension();
@@ -189,7 +189,7 @@ public class PearsonsCorrelation {
      * @return matrix of p-values
      * @throws org.apache.commons.math4.legacy.exception.MaxCountExceededException
      * if an error occurs estimating probabilities
-     * @throws NullPointerException if this instance was created with no data
+     * @throws NullPointerException if this instance was created with no data.
      */
     public RealMatrix getCorrelationPValues() {
         TDistribution tDistribution = new TDistribution(nObs - 2);
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/SpearmansCorrelation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/SpearmansCorrelation.java
index 881c754..c53b234 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/SpearmansCorrelation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/SpearmansCorrelation.java
@@ -39,13 +39,13 @@ import org.apache.commons.math4.legacy.stat.ranking.RankingAlgorithm;
  */
 public class SpearmansCorrelation {
 
-    /** Input data */
+    /** Input data. */
     private final RealMatrix data;
 
-    /** Ranking algorithm  */
+    /** Ranking algorithm.  */
     private final RankingAlgorithm rankingAlgorithm;
 
-    /** Rank correlation */
+    /** Rank correlation. */
     private final PearsonsCorrelation rankCorrelation;
 
     /**
@@ -115,7 +115,7 @@ public class SpearmansCorrelation {
      * Calculate the Spearman Rank Correlation Matrix.
      *
      * @return Spearman Rank Correlation Matrix
-     * @throws NullPointerException if this instance was created with no data
+     * @throws NullPointerException if this instance was created with no data.
      */
     public RealMatrix getCorrelationMatrix() {
         return rankCorrelation.getCorrelationMatrix();
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessBivariateCovariance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessBivariateCovariance.java
index 428eb69..83a010b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessBivariateCovariance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessBivariateCovariance.java
@@ -37,19 +37,19 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
  */
 class StorelessBivariateCovariance {
 
-    /** the mean of variable x */
+    /** the mean of variable x. */
     private double meanX;
 
-    /** the mean of variable y */
+    /** the mean of variable y. */
     private double meanY;
 
-    /** number of observations */
+    /** number of observations. */
     private double n;
 
-    /** the running covariance estimate */
+    /** the running covariance estimate. */
     private double covarianceNumerator;
 
-    /** flag for bias correction */
+    /** flag for bias correction. */
     private boolean biasCorrected;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessCovariance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessCovariance.java
index 85193d1..09aeb02 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessCovariance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/correlation/StorelessCovariance.java
@@ -41,10 +41,10 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
  */
 public class StorelessCovariance extends Covariance {
 
-    /** the square covariance matrix (upper triangular part) */
+    /** the square covariance matrix (upper triangular part). */
     private StorelessBivariateCovariance[] covMatrix;
 
-    /** dimension of the square covariance matrix */
+    /** dimension of the square covariance matrix. */
     private int dimension;
 
     /**
@@ -99,7 +99,7 @@ public class StorelessCovariance extends Covariance {
     }
 
     /**
-     * Gets the element at index (i, j) from the covariance matrix
+     * Gets the element at index (i, j) from the covariance matrix.
      * @param i the row index
      * @param j the column index
      * @return the {@link StorelessBivariateCovariance} element at the given index
@@ -109,7 +109,7 @@ public class StorelessCovariance extends Covariance {
     }
 
     /**
-     * Sets the covariance element at index (i, j) in the covariance matrix
+     * Sets the covariance element at index (i, j) in the covariance matrix.
      * @param i the row index
      * @param j the column index
      * @param cov the {@link StorelessBivariateCovariance} element to be set
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractStorelessUnivariateStatistic.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractStorelessUnivariateStatistic.java
index a42f768..37d3952 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractStorelessUnivariateStatistic.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractStorelessUnivariateStatistic.java
@@ -114,7 +114,7 @@ public abstract class AbstractStorelessUnivariateStatistic
      * {@inheritDoc}
      */
     @Override
-    public abstract void increment(final double d);
+    public abstract void increment(double d);
 
     /**
      * This default implementation just calls {@link #increment} in a loop over
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractUnivariateStatistic.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractUnivariateStatistic.java
index b5f0afb..0e0da1b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractUnivariateStatistic.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AbstractUnivariateStatistic.java
@@ -48,7 +48,7 @@ public abstract class AbstractUnivariateStatistic
      * {@inheritDoc}
      */
     @Override
-    public abstract double evaluate(final double[] values, final int begin, final int length)
+    public abstract double evaluate(double[] values, int begin, int length)
         throws MathIllegalArgumentException;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AggregateSummaryStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AggregateSummaryStatistics.java
index dca0205..bf41749 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AggregateSummaryStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/AggregateSummaryStatistics.java
@@ -54,11 +54,11 @@ public class AggregateSummaryStatistics implements StatisticalSummary,
         Serializable {
 
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = -8207112444016386906L;
 
     /**
-     * A SummaryStatistics serving as a prototype for creating SummaryStatistics
+     * A SummaryStatistics serving as a prototype for creating SummaryStatistics.
      * contributing to this aggregate
      */
     private final SummaryStatistics statisticsPrototype;
@@ -362,18 +362,18 @@ public class AggregateSummaryStatistics implements StatisticalSummary,
     private static class AggregatingSummaryStatistics extends SummaryStatistics {
 
         /**
-         * The serialization version of this class
+         * The serialization version of this class.
          */
         private static final long serialVersionUID = 1L;
 
         /**
-         * An additional SummaryStatistics into which values added to these
+         * An additional SummaryStatistics into which values added to these.
          * statistics (and possibly others) are aggregated
          */
         private final SummaryStatistics aggregateStatistics;
 
         /**
-         * Initializes a new AggregatingSummaryStatistics with the specified
+         * Initializes a new AggregatingSummaryStatistics with the specified.
          * aggregate statistics object
          *
          * @param aggregateStatistics a {@code SummaryStatistics} into which
@@ -418,7 +418,7 @@ public class AggregateSummaryStatistics implements StatisticalSummary,
         }
 
         /**
-         * Returns hash code based on values of statistics
+         * Returns hash code based on values of statistics.
          * @return hash code
          */
         @Override
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java
index f54f95a..ae7def1 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DescriptiveStatistics.java
@@ -65,13 +65,13 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
      */
     public static final int INFINITE_WINDOW = -1;
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = 4133067267405273064L;
 
     /** Name of the setQuantile method. */
     private static final String SET_QUANTILE_METHOD_NAME = "setQuantile";
 
-    /** hold the window size **/
+    /** hold the window size. */
     private int windowSize = INFINITE_WINDOW;
 
     /** Stored data values. */
@@ -215,7 +215,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
 
     /**
      * Returns the <a href="http://www.xycoon.com/arithmetic_mean.htm">
-     * arithmetic mean </a> of the available values
+     * arithmetic mean </a> of the available values.
      * @return The mean or Double.NaN if no values have been added.
      */
     @Override
@@ -313,7 +313,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the maximum of the available values
+     * Returns the maximum of the available values.
      * @return The max or Double.NaN if no values have been added.
      */
     @Override
@@ -322,7 +322,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-    * Returns the minimum of the available values
+    * Returns the minimum of the available values.
     * @return The min or Double.NaN if no values have been added.
     */
     @Override
@@ -331,7 +331,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the number of available values
+     * Returns the number of available values.
      * @return The number of available values
      */
     @Override
@@ -358,7 +358,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Resets all statistics and storage
+     * Resets all statistics and storage.
      */
     public void clear() {
         eDA.clear();
@@ -433,7 +433,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the element at the specified index
+     * Returns the element at the specified index.
      * @param index The Index of the element
      * @return return the element at the specified index
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java
index c5b5a93..eb31414 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/DoubleArray.java
@@ -60,14 +60,14 @@ interface DoubleArray { // Not in public API.
     void setElement(int index, double value);
 
     /**
-     * Adds an element to the end of this expandable array
+     * Adds an element to the end of this expandable array.
      *
      * @param value to be added to end of array
      */
     void addElement(double value);
 
     /**
-     * Adds elements to the end of this expandable array
+     * Adds elements to the end of this expandable array.
      *
      * @param values to be added to end of array
      */
@@ -103,7 +103,7 @@ interface DoubleArray { // Not in public API.
     double[] getElements();
 
     /**
-     * Clear the double array
+     * Clear the double array.
      */
     void clear();
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/MultivariateSummaryStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/MultivariateSummaryStatistics.java
index 3028428..128bf9b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/MultivariateSummaryStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/MultivariateSummaryStatistics.java
@@ -70,13 +70,13 @@ import org.apache.commons.numbers.core.Precision;
 public class MultivariateSummaryStatistics
     implements StatisticalMultivariateSummary, Serializable {
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = 2271900808994826718L;
 
     /** Dimension of the data. */
     private final int k;
 
-    /** Count of values that have been added */
+    /** Count of values that have been added. */
     private long n;
 
     /** Sum statistic implementation - can be reset by setter. */
@@ -104,7 +104,7 @@ public class MultivariateSummaryStatistics
     private final VectorialCovariance covarianceImpl;
 
     /**
-     * Construct a MultivariateSummaryStatistics instance
+     * Construct a MultivariateSummaryStatistics instance.
      * @param k dimension of the data
      * @param isCovarianceBiasCorrected if true, the unbiased sample
      * covariance is computed, otherwise the biased population covariance
@@ -137,7 +137,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Add an n-tuple to the data
+     * Add an n-tuple to the data.
      *
      * @param value  the n-tuple to add
      * @throws DimensionMismatchException if the length of the array
@@ -160,7 +160,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the dimension of the data
+     * Returns the dimension of the data.
      * @return The dimension of the data
      */
     @Override
@@ -169,7 +169,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the number of available values
+     * Returns the number of available values.
      * @return The number of available values
      */
     @Override
@@ -191,7 +191,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the sum of the
+     * Returns an array whose i<sup>th</sup> entry is the sum of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -203,7 +203,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the sum of squares of the
+     * Returns an array whose i<sup>th</sup> entry is the sum of squares of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -215,7 +215,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the sum of logs of the
+     * Returns an array whose i<sup>th</sup> entry is the sum of logs of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -227,7 +227,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the mean of the
+     * Returns an array whose i<sup>th</sup> entry is the mean of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -239,7 +239,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the standard deviation of the
+     * Returns an array whose i<sup>th</sup> entry is the standard deviation of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -272,7 +272,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the maximum of the
+     * Returns an array whose i<sup>th</sup> entry is the maximum of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -284,7 +284,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the minimum of the
+     * Returns an array whose i<sup>th</sup> entry is the minimum of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -296,7 +296,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the geometric mean of the
+     * Returns an array whose i<sup>th</sup> entry is the geometric mean of the.
      * i<sup>th</sup> entries of the arrays that have been added using
      * {@link #addValue(double[])}
      *
@@ -352,7 +352,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Resets all statistics and storage
+     * Resets all statistics and storage.
      */
     public void clear() {
         this.n = 0;
@@ -395,7 +395,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns hash code based on values of statistics
+     * Returns hash code based on values of statistics.
      *
      * @return hash code
      */
@@ -433,7 +433,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured Sum implementation
+     * Returns the currently configured Sum implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the sum
      */
@@ -460,7 +460,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured sum of squares implementation
+     * Returns the currently configured sum of squares implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the sum of squares
      */
@@ -487,7 +487,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured minimum implementation
+     * Returns the currently configured minimum implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the minimum
      */
@@ -514,7 +514,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured maximum implementation
+     * Returns the currently configured maximum implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the maximum
      */
@@ -541,7 +541,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured sum of logs implementation
+     * Returns the currently configured sum of logs implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the log sum
      */
@@ -568,7 +568,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured geometric mean implementation
+     * Returns the currently configured geometric mean implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the geometric mean
      */
@@ -595,7 +595,7 @@ public class MultivariateSummaryStatistics
     }
 
     /**
-     * Returns the currently configured mean implementation
+     * Returns the currently configured mean implementation.
      *
      * @return the StorelessUnivariateStatistic implementing the mean
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java
index 42153d1..de33db3 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/ResizableDoubleArray.java
@@ -151,7 +151,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      *  <li>{@code contractionCriterion = 2.5}</li>
      * </ul>
      */
-    public ResizableDoubleArray() {
+    ResizableDoubleArray() {
         this(DEFAULT_INITIAL_CAPACITY);
     }
 
@@ -167,7 +167,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @param initialCapacity Initial size of the internal storage array.
      * @throws MathIllegalArgumentException if {@code initialCapacity <= 0}.
      */
-    public ResizableDoubleArray(int initialCapacity) throws MathIllegalArgumentException {
+    ResizableDoubleArray(int initialCapacity) throws MathIllegalArgumentException {
         this(initialCapacity, DEFAULT_EXPANSION_FACTOR);
     }
 
@@ -189,7 +189,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @param initialArray initial array
      * @since 2.2
      */
-    public ResizableDoubleArray(double[] initialArray) {
+    ResizableDoubleArray(double[] initialArray) {
         this(initialArray == null || initialArray.length == 0 ?
               DEFAULT_INITIAL_CAPACITY :
               initialArray.length,
@@ -221,7 +221,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @throws MathIllegalArgumentException if parameters are not valid.
      * @since 3.1
      */
-    public ResizableDoubleArray(int initialCapacity, double expansionFactor) throws MathIllegalArgumentException {
+    ResizableDoubleArray(int initialCapacity, double expansionFactor) throws MathIllegalArgumentException {
         this(initialCapacity, expansionFactor, DEFAULT_CONTRACTION_DELTA + expansionFactor);
     }
 
@@ -245,7 +245,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @throws MathIllegalArgumentException if the parameters are not valid.
      * @since 3.1
      */
-    public ResizableDoubleArray(int initialCapacity, double expansionFactor, double contractionCriterion)
+    ResizableDoubleArray(int initialCapacity, double expansionFactor, double contractionCriterion)
         throws MathIllegalArgumentException {
         this(initialCapacity, expansionFactor, contractionCriterion, DEFAULT_EXPANSION_MODE);
     }
@@ -269,11 +269,11 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @throws MathIllegalArgumentException if the parameters are not valid.
      * @throws NullArgumentException if expansionMode is null
      */
-    public ResizableDoubleArray(int initialCapacity,
-                                double expansionFactor,
-                                double contractionCriterion,
-                                ExpansionMode expansionMode,
-                                double ... data)
+    ResizableDoubleArray(int initialCapacity,
+                         double expansionFactor,
+                         double contractionCriterion,
+                         ExpansionMode expansionMode,
+                         double ... data)
         throws MathIllegalArgumentException {
         if (initialCapacity <= 0) {
             throw new NotStrictlyPositiveException(LocalizedFormats.INITIAL_CAPACITY_NOT_POSITIVE,
@@ -304,7 +304,7 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
      * @exception NullArgumentException if original is null
      * @since 2.0
      */
-    public ResizableDoubleArray(final ResizableDoubleArray original)
+    ResizableDoubleArray(final ResizableDoubleArray original)
         throws NullArgumentException {
         NullArgumentException.check(original);
         this.contractionCriterion = original.contractionCriterion;
@@ -813,16 +813,16 @@ class ResizableDoubleArray implements DoubleArray, Serializable { // Not in publ
         if (object == this ) {
             return true;
         }
-        if (object instanceof ResizableDoubleArray == false) {
+        if (!(object instanceof ResizableDoubleArray)) {
             return false;
         }
         boolean result = true;
         final ResizableDoubleArray other = (ResizableDoubleArray) object;
-        result = result && (other.contractionCriterion == contractionCriterion);
-        result = result && (other.expansionFactor == expansionFactor);
-        result = result && (other.expansionMode == expansionMode);
-        result = result && (other.numElements == numElements);
-        result = result && (other.startIndex == startIndex);
+        result = result && other.contractionCriterion == contractionCriterion;
+        result = result && other.expansionFactor == expansionFactor;
+        result = result && other.expansionMode == expansionMode;
+        result = result && other.numElements == numElements;
+        result = result && other.startIndex == startIndex;
         if (!result) {
             return false;
         } else {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalMultivariateSummary.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalMultivariateSummary.java
index a19aba7..56ab55b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalMultivariateSummary.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalMultivariateSummary.java
@@ -26,13 +26,13 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
 public interface StatisticalMultivariateSummary {
 
     /**
-     * Returns the dimension of the data
+     * Returns the dimension of the data.
      * @return The dimension of the data
      */
     int getDimension();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * mean of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -48,7 +48,7 @@ public interface StatisticalMultivariateSummary {
     RealMatrix getCovariance();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * standard deviation of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -57,7 +57,7 @@ public interface StatisticalMultivariateSummary {
     double[] getStandardDeviation();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * maximum of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -66,7 +66,7 @@ public interface StatisticalMultivariateSummary {
     double[] getMax();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * minimum of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -75,13 +75,13 @@ public interface StatisticalMultivariateSummary {
     double[] getMin();
 
     /**
-     * Returns the number of available values
+     * Returns the number of available values.
      * @return The number of available values
      */
     long getN();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * geometric mean of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -90,7 +90,7 @@ public interface StatisticalMultivariateSummary {
     double[] getGeometricMean();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * sum of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -99,7 +99,7 @@ public interface StatisticalMultivariateSummary {
     double[] getSum();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * sum of squares of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
@@ -108,7 +108,7 @@ public interface StatisticalMultivariateSummary {
     double[] getSumSq();
 
     /**
-     * Returns an array whose i<sup>th</sup> entry is the
+     * Returns an array whose i<sup>th</sup> entry is the.
      * sum of logs of the i<sup>th</sup> entries of the arrays
      * that correspond to each multivariate sample
      *
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummary.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummary.java
index 1befe9d..9700454 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummary.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummary.java
@@ -24,7 +24,7 @@ public interface StatisticalSummary {
 
     /**
      * Returns the <a href="http://www.xycoon.com/arithmetic_mean.htm">
-     * arithmetic mean </a> of the available values
+     * arithmetic mean </a> of the available values.
      * @return The mean or Double.NaN if no values have been added.
      */
     double getMean();
@@ -41,17 +41,17 @@ public interface StatisticalSummary {
      */
     double getStandardDeviation();
     /**
-     * Returns the maximum of the available values
+     * Returns the maximum of the available values.
      * @return The max or Double.NaN if no values have been added.
      */
     double getMax();
     /**
-    * Returns the minimum of the available values
+    * Returns the minimum of the available values.
     * @return The min or Double.NaN if no values have been added.
     */
     double getMin();
     /**
-     * Returns the number of available values
+     * Returns the number of available values.
      * @return The number of available values
      */
     long getN();
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummaryValues.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummaryValues.java
index 6cac22d..23fae65 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummaryValues.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StatisticalSummaryValues.java
@@ -28,29 +28,29 @@ import org.apache.commons.numbers.core.Precision;
 public class StatisticalSummaryValues implements Serializable,
     StatisticalSummary {
 
-    /** Serialization id */
+    /** Serialization id. */
     private static final long serialVersionUID = -5108854841843722536L;
 
-    /** The sample mean */
+    /** The sample mean. */
     private final double mean;
 
-    /** The sample variance */
+    /** The sample variance. */
     private final double variance;
 
-    /** The number of observations in the sample */
+    /** The number of observations in the sample. */
     private final long n;
 
-    /** The maximum value */
+    /** The maximum value. */
     private final double max;
 
-    /** The minimum value */
+    /** The minimum value. */
     private final double min;
 
-    /** The sum of the sample values */
+    /** The sum of the sample values. */
     private final double sum;
 
     /**
-      * Constructor
+      * Constructor.
       *
       * @param mean  the sample mean
       * @param variance  the sample variance
@@ -152,7 +152,7 @@ public class StatisticalSummaryValues implements Serializable,
     }
 
     /**
-     * Returns hash code based on values of statistics
+     * Returns hash code based on values of statistics.
      *
      * @return hash code
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StorelessUnivariateStatistic.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StorelessUnivariateStatistic.java
index a90e52e..a6e88bc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StorelessUnivariateStatistic.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/StorelessUnivariateStatistic.java
@@ -76,7 +76,7 @@ public interface StorelessUnivariateStatistic extends UnivariateStatistic {
     long getN();
 
     /**
-     * Clears the internal state of the Statistic
+     * Clears the internal state of the Statistic.
      */
     void clear();
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SummaryStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SummaryStatistics.java
index 90629f3..c3b9c5d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SummaryStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SummaryStatistics.java
@@ -58,37 +58,37 @@ import org.apache.commons.numbers.core.Precision;
  */
 public class SummaryStatistics implements StatisticalSummary, Serializable {
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = -2021321786743555871L;
 
-    /** count of values that have been added */
+    /** count of values that have been added. */
     private long n;
 
-    /** SecondMoment is used to compute the mean and variance */
+    /** SecondMoment is used to compute the mean and variance. */
     private SecondMoment secondMoment = new SecondMoment();
 
-    /** sum of values that have been added */
+    /** sum of values that have been added. */
     private Sum sum = new Sum();
 
-    /** sum of the square of each value that has been added */
+    /** sum of the square of each value that has been added. */
     private SumOfSquares sumsq = new SumOfSquares();
 
-    /** min of values that have been added */
+    /** min of values that have been added. */
     private Min min = new Min();
 
-    /** max of values that have been added */
+    /** max of values that have been added. */
     private Max max = new Max();
 
-    /** sumLog of values that have been added */
+    /** sumLog of values that have been added. */
     private SumOfLogs sumLog = new SumOfLogs();
 
-    /** geoMean of values that have been added */
+    /** geoMean of values that have been added. */
     private GeometricMean geoMean = new GeometricMean(sumLog);
 
-    /** mean of values that have been added */
+    /** mean of values that have been added. */
     private Mean mean = new Mean(secondMoment);
 
-    /** variance of values that have been added */
+    /** variance of values that have been added. */
     private Variance variance = new Variance(secondMoment);
 
     /** Sum statistic implementation - can be reset by setter. */
@@ -116,7 +116,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     private StorelessUnivariateStatistic varianceImpl = variance;
 
     /**
-     * Construct a SummaryStatistics instance
+     * Construct a SummaryStatistics instance.
      */
     public SummaryStatistics() {
     }
@@ -142,7 +142,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Add a value to the data
+     * Add a value to the data.
      * @param value the value to add
      */
     public void addValue(double value) {
@@ -167,7 +167,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the number of available values
+     * Returns the number of available values.
      * @return The number of available values
      */
     @Override
@@ -176,7 +176,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the sum of the values that have been added
+     * Returns the sum of the values that have been added.
      * @return The sum or <code>Double.NaN</code> if no values have been added
      */
     @Override
@@ -360,7 +360,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Resets all statistics and storage
+     * Resets all statistics and storage.
      */
     public void clear() {
         this.n = 0;
@@ -406,7 +406,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns hash code based on values of statistics
+     * Returns hash code based on values of statistics.
      * @return hash code
      */
     @Override
@@ -425,7 +425,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
 
     // Getters and setters for statistics implementations
     /**
-     * Returns the currently configured Sum implementation
+     * Returns the currently configured Sum implementation.
      * @return the StorelessUnivariateStatistic implementing the sum
      * @since 1.2
      */
@@ -455,7 +455,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured sum of squares implementation
+     * Returns the currently configured sum of squares implementation.
      * @return the StorelessUnivariateStatistic implementing the sum of squares
      * @since 1.2
      */
@@ -485,7 +485,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured minimum implementation
+     * Returns the currently configured minimum implementation.
      * @return the StorelessUnivariateStatistic implementing the minimum
      * @since 1.2
      */
@@ -515,7 +515,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured maximum implementation
+     * Returns the currently configured maximum implementation.
      * @return the StorelessUnivariateStatistic implementing the maximum
      * @since 1.2
      */
@@ -545,7 +545,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured sum of logs implementation
+     * Returns the currently configured sum of logs implementation.
      * @return the StorelessUnivariateStatistic implementing the log sum
      * @since 1.2
      */
@@ -576,7 +576,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured geometric mean implementation
+     * Returns the currently configured geometric mean implementation.
      * @return the StorelessUnivariateStatistic implementing the geometric mean
      * @since 1.2
      */
@@ -606,7 +606,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured mean implementation
+     * Returns the currently configured mean implementation.
      * @return the StorelessUnivariateStatistic implementing the mean
      * @since 1.2
      */
@@ -636,7 +636,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable {
     }
 
     /**
-     * Returns the currently configured variance implementation
+     * Returns the currently configured variance implementation.
      * @return the StorelessUnivariateStatistic implementing the variance
      * @since 1.2
      */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatistics.java
index ef07e2b..8d5618c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedDescriptiveStatistics.java
@@ -33,11 +33,11 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
  */
 public class SynchronizedDescriptiveStatistics extends DescriptiveStatistics {
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = 1L;
 
     /**
-     * Construct an instance with infinite window
+     * Construct an instance with infinite window.
      */
     public SynchronizedDescriptiveStatistics() {
         // no try-catch or advertized IAE because arg is valid
@@ -45,7 +45,7 @@ public class SynchronizedDescriptiveStatistics extends DescriptiveStatistics {
     }
 
     /**
-     * Construct an instance with finite window
+     * Construct an instance with finite window.
      * @param window the finite window size.
      * @throws MathIllegalArgumentException if window size is less than 1 but
      * not equal to {@link #INFINITE_WINDOW}
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatistics.java
index 6167fee..65af993 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedMultivariateSummaryStatistics.java
@@ -34,11 +34,11 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
 public class SynchronizedMultivariateSummaryStatistics
     extends MultivariateSummaryStatistics {
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = 7099834153347155363L;
 
     /**
-     * Construct a SynchronizedMultivariateSummaryStatistics instance
+     * Construct a SynchronizedMultivariateSummaryStatistics instance.
      * @param k dimension of the data
      * @param isCovarianceBiasCorrected if true, the unbiased sample
      * covariance is computed, otherwise the biased population covariance
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatistics.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatistics.java
index 8d9f8b7..a736345 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatistics.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/SynchronizedSummaryStatistics.java
@@ -33,11 +33,11 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
  */
 public class SynchronizedSummaryStatistics extends SummaryStatistics {
 
-    /** Serialization UID */
+    /** Serialization UID. */
     private static final long serialVersionUID = 1909861009042253704L;
 
     /**
-     * Construct a SynchronizedSummaryStatistics instance
+     * Construct a SynchronizedSummaryStatistics instance.
      */
     public SynchronizedSummaryStatistics() {
         super();
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FirstMoment.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FirstMoment.java
index d1da0e5..2d08961 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FirstMoment.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FirstMoment.java
@@ -48,13 +48,13 @@ import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivari
 class FirstMoment extends AbstractStorelessUnivariateStatistic
     implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Count of values that have been added */
+    /** Count of values that have been added. */
     protected long n;
 
-    /** First moment of values that have been added */
+    /** First moment of values that have been added. */
     protected double m1;
 
     /**
@@ -71,7 +71,7 @@ class FirstMoment extends AbstractStorelessUnivariateStatistic
     protected double nDev;
 
     /**
-     * Create a FirstMoment instance
+     * Create a FirstMoment instance.
      */
     FirstMoment() {
         n = 0;
@@ -81,7 +81,7 @@ class FirstMoment extends AbstractStorelessUnivariateStatistic
     }
 
     /**
-     * Copy constructor, creates a new {@code FirstMoment} identical
+     * Copy constructor, creates a new {@code FirstMoment} identical.
      * to the {@code original}
      *
      * @param original the {@code FirstMoment} instance to copy
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FourthMoment.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FourthMoment.java
index 4392f9a..a7de373 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FourthMoment.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/FourthMoment.java
@@ -54,14 +54,14 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
  */
 class FourthMoment extends ThirdMoment implements Serializable{
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** fourth moment of values that have been added */
+    /** fourth moment of values that have been added. */
     private double m4;
 
     /**
-     * Create a FourthMoment instance
+     * Create a FourthMoment instance.
      */
     FourthMoment() {
         super();
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/GeometricMean.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/GeometricMean.java
index 00dc11b..09e683c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/GeometricMean.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/GeometricMean.java
@@ -50,10 +50,10 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class GeometricMean extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Wrapped SumOfLogs instance */
+    /** Wrapped SumOfLogs instance. */
     private StorelessUnivariateStatistic sumOfLogs;
 
     /**
@@ -76,7 +76,7 @@ public class GeometricMean extends AbstractStorelessUnivariateStatistic implemen
     }
 
     /**
-     * Create a GeometricMean instance using the given SumOfLogs instance
+     * Create a GeometricMean instance using the given SumOfLogs instance.
      * @param sumOfLogs sum of logs instance to use for computation.
      */
     public GeometricMean(SumOfLogs sumOfLogs) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Kurtosis.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Kurtosis.java
index 2d18946..367a223 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Kurtosis.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Kurtosis.java
@@ -47,10 +47,10 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Kurtosis extends AbstractStorelessUnivariateStatistic  implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /**Fourth Moment on which this statistic is based */
+    /**Fourth Moment on which this statistic is based. */
     protected FourthMoment moment;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Mean.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Mean.java
index 91de459..50dc944 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Mean.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Mean.java
@@ -62,7 +62,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
 public class Mean extends AbstractStorelessUnivariateStatistic
     implements Serializable, WeightedEvaluation {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
     /** First moment on which this statistic is based. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SecondMoment.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SecondMoment.java
index 943330e..44f9bc3 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SecondMoment.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SecondMoment.java
@@ -46,10 +46,10 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
  */
 public class SecondMoment extends FirstMoment implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** second moment of values that have been added */
+    /** second moment of values that have been added. */
     protected double m2;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SemiVariance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SemiVariance.java
index 475a68b..5d77c60 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SemiVariance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/SemiVariance.java
@@ -60,12 +60,12 @@ public class SemiVariance extends AbstractUnivariateStatistic implements Seriali
     public static final Direction UPSIDE_VARIANCE = Direction.UPSIDE;
 
     /**
-     * The DOWNSIDE Direction is used to specify that the observations below
+     * The DOWNSIDE Direction is used to specify that the observations below.
      * the cutoff point will be used to calculate SemiVariance
      */
     public static final Direction DOWNSIDE_VARIANCE = Direction.DOWNSIDE;
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
     /**
@@ -99,7 +99,7 @@ public class SemiVariance extends AbstractUnivariateStatistic implements Seriali
     }
 
     /**
-     * Constructs a SemiVariance with the specified <code>Direction</code> property
+     * Constructs a SemiVariance with the specified <code>Direction</code> property.
      * and default (true) <code>biasCorrected</code> property
      *
      * @param direction  setting for the direction of the SemiVariance
@@ -311,7 +311,7 @@ public class SemiVariance extends AbstractUnivariateStatistic implements Seriali
      }
 
      /**
-      * Sets the variance direction
+      * Sets the variance direction.
       *
       * @param varianceDirection the direction of the semivariance
       */
@@ -325,19 +325,19 @@ public class SemiVariance extends AbstractUnivariateStatistic implements Seriali
       */
      public enum Direction {
          /**
-          * The UPSIDE Direction is used to specify that the observations above the
+          * The UPSIDE Direction is used to specify that the observations above the.
           * cutoff point will be used to calculate SemiVariance
           */
          UPSIDE (true),
 
          /**
-          * The DOWNSIDE Direction is used to specify that the observations below
+          * The DOWNSIDE Direction is used to specify that the observations below.
           * the cutoff point will be used to calculate SemiVariance
           */
          DOWNSIDE (false);
 
          /**
-          * boolean value  UPSIDE <-> true
+          * boolean value  UPSIDE <-> true.
           */
          private boolean direction;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Skewness.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Skewness.java
index 7945614..3e7fa53 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Skewness.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Skewness.java
@@ -46,10 +46,10 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Skewness extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Third moment on which this statistic is based */
+    /** Third moment on which this statistic is based. */
     protected ThirdMoment moment;
 
      /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/StandardDeviation.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/StandardDeviation.java
index b747f77..cd9483f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/StandardDeviation.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/StandardDeviation.java
@@ -41,10 +41,10 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 public class StandardDeviation extends AbstractStorelessUnivariateStatistic
     implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Wrapped Variance instance */
+    /** Wrapped Variance instance. */
     private Variance variance;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/ThirdMoment.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/ThirdMoment.java
index 7eea1e2..bf16bf8 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/ThirdMoment.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/ThirdMoment.java
@@ -49,10 +49,10 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
  */
 class ThirdMoment extends SecondMoment implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** third moment of values that have been added */
+    /** third moment of values that have been added. */
     protected double m3;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Variance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Variance.java
index 9740518..9c235da 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Variance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/Variance.java
@@ -67,10 +67,10 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Variance extends AbstractStorelessUnivariateStatistic implements Serializable, WeightedEvaluation {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** SecondMoment is used in incremental calculation of Variance*/
+    /** SecondMoment is used in incremental calculation of Variance. */
     protected SecondMoment moment;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovariance.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovariance.java
index 0cc32e9..dfa0d71 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovariance.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialCovariance.java
@@ -29,7 +29,7 @@ import org.apache.commons.math4.legacy.linear.RealMatrix;
  */
 public class VectorialCovariance implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 4118372414238930270L;
 
     /** Sums for each component. */
@@ -109,7 +109,7 @@ public class VectorialCovariance implements Serializable {
     }
 
     /**
-     * Clears the internal state of the Statistic
+     * Clears the internal state of the Statistic.
      */
     public void clear() {
         n = 0;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMean.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMean.java
index 477b863..d00b49a 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMean.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/moment/VectorialMean.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
  */
 public class VectorialMean implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 8223009086481006892L;
 
     /** Means for each component. */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java
index e6e0d2a..942737f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/CentralPivotingStrategy.java
@@ -18,7 +18,6 @@ package org.apache.commons.math4.legacy.stat.descriptive.rank;
 
 import java.io.Serializable;
 
-import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
 import org.apache.commons.math4.legacy.core.MathArrays;
 
 /**
@@ -34,7 +33,7 @@ public class CentralPivotingStrategy implements PivotingStrategy, Serializable {
      * This in particular picks a average of begin and end indices
      * @return The index corresponding to a simple average of
      * the first and the last element indices of the array slice
-     * @throws MathIllegalArgumentException when indices exceeds range
+     * @throws org.apache.commons.math4.legacy.exception.MathIllegalArgumentException MathIllegalArgumentException when indices exceeds range
      */
     @Override
     public int pivotIndex(final double[] work, final int begin, final int end) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java
index 7e48776..fd9d351 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/KthSelector.java
@@ -35,18 +35,18 @@ public class KthSelector implements Serializable {
     /** Minimum selection size for insertion sort rather than selection. */
     private static final int MIN_SELECT_SIZE = 15;
 
-    /** A {@link PivotingStrategy} used for pivoting  */
+    /** A {@link PivotingStrategy} used for pivoting. */
     private final PivotingStrategy pivotingStrategy;
 
     /**
-     * Constructor with default {@link MedianOf3PivotingStrategy median of 3} pivoting strategy
+     * Constructor with default {@link MedianOf3PivotingStrategy median of 3} pivoting strategy.
      */
     public KthSelector() {
         this.pivotingStrategy = new MedianOf3PivotingStrategy();
     }
 
     /**
-     * Constructor with specified pivoting strategy
+     * Constructor with specified pivoting strategy.
      *
      * @param pivotingStrategy pivoting strategy to use
      * @throws NullArgumentException when pivotingStrategy is null
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Max.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Max.java
index b3b7a90..b4db84e 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Max.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Max.java
@@ -39,13 +39,13 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Max extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Number of values that have been added */
+    /** Number of values that have been added. */
     private long n;
 
-    /** Current value of the statistic */
+    /** Current value of the statistic. */
     private double value;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java
index 26cf10f..b297fe5 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Median.java
@@ -34,7 +34,7 @@ import org.apache.commons.math4.legacy.stat.ranking.NaNStrategy;
  */
 public class Median extends Percentile implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
     /** Fixed quantile. */
@@ -49,7 +49,7 @@ public class Median extends Percentile implements Serializable {
     }
 
     /**
-     * Copy constructor, creates a new {@code Median} identical
+     * Copy constructor, creates a new {@code Median} identical.
      * to the {@code original}
      *
      * @param original the {@code Median} instance to copy
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java
index 671ccca..fedeb09 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/MedianOf3PivotingStrategy.java
@@ -18,10 +18,8 @@ package org.apache.commons.math4.legacy.stat.descriptive.rank;
 
 import java.io.Serializable;
 
-import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
 import org.apache.commons.math4.legacy.core.MathArrays;
 
-
 /**
  * Classic median of 3 strategy given begin and end indices.
  * @since 3.4
@@ -34,7 +32,7 @@ public class MedianOf3PivotingStrategy implements PivotingStrategy, Serializable
      * This in specific makes use of median of 3 pivoting.
      * @return The index corresponding to a pivot chosen between the
      * first, middle and the last indices of the array slice
-     * @throws MathIllegalArgumentException when indices exceeds range
+     * @throws org.apache.commons.math4.legacy.exception.MathIllegalArgumentException MathIllegalArgumentException when indices exceeds range
      */
     @Override
     public int pivotIndex(final double[] work, final int begin, final int end) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Min.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Min.java
index 760ba36..bebc707 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Min.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Min.java
@@ -39,13 +39,13 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Min extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /**Number of values that have been added */
+    /**Number of values that have been added. */
     private long n;
 
-    /**Current value of the statistic */
+    /**Current value of the statistic. */
     private double value;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentile.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentile.java
index 2d67afc..01664fa 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentile.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentile.java
@@ -38,14 +38,13 @@ import org.apache.commons.math4.legacy.exception.NullArgumentException;
 import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
 import org.apache.commons.math4.legacy.stat.descriptive.AbstractStorelessUnivariateStatistic;
 import org.apache.commons.math4.legacy.stat.descriptive.StorelessUnivariateStatistic;
-import org.apache.commons.math4.legacy.core.MathArrays;
 
 /**
  * A {@link StorelessUnivariateStatistic} estimating percentiles using the
- * <a href=http://www.cs.wustl.edu/~jain/papers/ftp/psqr.pdf>P<SUP>2</SUP></a>
- * Algorithm as explained by <a href=http://www.cse.wustl.edu/~jain/>Raj
+ * <a href="http://www.cs.wustl.edu/~jain/papers/ftp/psqr.pdf">P<SUP>2</SUP></a>
+ * Algorithm as explained by <a href="http://www.cse.wustl.edu/~jain/">Raj
  * Jain</a> and Imrich Chlamtac in
- * <a href=http://www.cse.wustl.edu/~jain/papers/psqr.htm>P<SUP>2</SUP> Algorithm
+ * <a href="http://www.cse.wustl.edu/~jain/papers/psqr.htm">P<SUP>2</SUP> Algorithm
  * for Dynamic Calculation of Quantiles and Histogram Without Storing
  * Observations</a>.
  * <p>
@@ -57,7 +56,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         implements StorelessUnivariateStatistic, Serializable {
 
     /**
-     * The maximum array size used for psquare algorithm
+     * The maximum array size used for psquare algorithm.
      */
     private static final int PSQUARE_CONSTANT = 5;
 
@@ -68,18 +67,18 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     private static final double DEFAULT_QUANTILE_DESIRED = 50d;
 
     /**
-     * Serial ID
+     * Serial ID.
      */
     private static final long serialVersionUID = 20150412L;
 
     /**
-     * A decimal formatter for print convenience
+     * A decimal formatter for print convenience.
      */
     private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("00.00");
 
     /**
      * Initial list of 5 numbers corresponding to 5 markers. <b>NOTE:</b>watch
-     * out for the add methods that are overloaded
+     * out for the add methods that are overloaded.
      */
     private final List<Double> initialFive = new FixedCapacityList<>(PSQUARE_CONSTANT);
 
@@ -97,18 +96,18 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     private transient double lastObservation;
 
     /**
-     * Markers is the marker collection object which comes to effect
+     * Markers is the marker collection object which comes to effect.
      * only after 5 values are inserted
      */
     private PSquareMarkers markers;
 
     /**
-     * Computed p value (i,e percentile value of data set hither to received)
+     * Computed p value (i,e percentile value of data set hither to received).
      */
     private double pValue = Double.NaN;
 
     /**
-     * Counter to count the values/observations accepted into this data set
+     * Counter to count the values/observations accepted into this data set.
      */
     private long countOfObservations;
 
@@ -146,7 +145,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     }
 
     /**
-     * Returns true iff {@code o} is a {@code PSquarePercentile} returning the
+     * Returns true iff {@code o} is a {@code PSquarePercentile} returning the.
      * same values as this for {@code getResult()} and {@code getN()} and also
      * having equal markers
      *
@@ -248,7 +247,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     }
 
     /**
-     * Returns the quantile estimated by this statistic in the range [0.0-1.0]
+     * Returns the quantile estimated by this statistic in the range [0.0-1.0].
      *
      * @return quantile estimated by {@link #getResult()}
      */
@@ -311,20 +310,20 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
      * Markers is an encapsulation of the five markers/buckets as indicated in
      * the original works.
      */
-    private static class Markers implements PSquareMarkers, Serializable {
+    private static final class Markers implements PSquareMarkers, Serializable {
         /**
-         * Serial version id
+         * Serial version id.
          */
         private static final long serialVersionUID = 1L;
 
-        /** Low marker index */
+        /** Low marker index. */
         private static final int LOW = 2;
 
-        /** High marker index */
+        /** High marker index. */
         private static final int HIGH = 4;
 
         /**
-         * Array of 5+1 Markers (The first marker is dummy just so we
+         * Array of 5+1 Markers (The first marker is dummy just so we.
          * can match the rest of indexes [1-5] indicated in the original works
          * which follows unit based index)
          */
@@ -337,7 +336,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         private transient int k = -1;
 
         /**
-         * Constructor
+         * Constructor.
          *
          * @param theMarkerArray marker array to be used
          */
@@ -355,7 +354,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         }
 
         /**
-         * Constructor
+         * Constructor.
          *
          * @param initialFive elements required to build Marker
          * @param p quantile required to be computed
@@ -365,7 +364,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         }
 
         /**
-         * Creates a marker array using initial five elements and a quantile
+         * Creates a marker array using initial five elements and a quantile.
          *
          * @param initialFive list of initial five elements
          * @param p the pth quantile
@@ -418,7 +417,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         }
 
         /**
-         * Process a data point
+         * Process a data point.
          *
          * @param inputDataPoint is the data point passed
          * @return computed percentile
@@ -544,7 +543,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         }
 
         /**
-         * Return marker height given index
+         * Return marker height given index.
          *
          * @param markerIndex index of marker within (1,6)
          * @return marker height
@@ -589,12 +588,12 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     }
 
     /**
-     * The class modeling the attributes of the marker of the P-square algorithm
+     * The class modeling the attributes of the marker of the P-square algorithm.
      */
-    private static class Marker implements Serializable, Cloneable {
+    private static final class Marker implements Serializable, Cloneable {
 
         /**
-         * Serial Version ID
+         * Serial Version ID.
          */
         private static final long serialVersionUID = -3575879478288538431L;
 
@@ -635,29 +634,29 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         private transient Marker next;
 
         /**
-         * The previous marker links
+         * The previous marker links.
          */
         private transient Marker previous;
 
         /**
-         * Nonlinear interpolator
+         * Nonlinear interpolator.
          */
         private final UnivariateInterpolator nonLinear = new NevilleInterpolator();
 
         /**
-         * Linear interpolator which is not serializable
+         * Linear interpolator which is not serializable.
          */
         private transient UnivariateInterpolator linear = new LinearInterpolator();
 
         /**
-         * Default constructor
+         * Default constructor.
          */
         private Marker() {
             this.next = this.previous = this;
         }
 
         /**
-         * Constructor of the marker with parameters
+         * Constructor of the marker with parameters.
          *
          * @param heightOfMarker represent the quantile value
          * @param makerPositionDesired represent the desired marker position
@@ -727,7 +726,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
         }
 
         /**
-         * Difference between desired and actual position
+         * Difference between desired and actual position.
          *
          * @return difference between desired and actual position
          */
@@ -881,16 +880,16 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     private static class FixedCapacityList<E> extends ArrayList<E> implements Serializable {
 
         /**
-         * Serialization Version Id
+         * Serialization Version Id.
          */
         private static final long serialVersionUID = 2283952083075725479L;
         /**
-         * Capacity of the list
+         * Capacity of the list.
          */
         private final int capacity;
 
         /**
-         * This constructor constructs the list with given capacity and as well
+         * This constructor constructs the list with given capacity and as well.
          * as stores the capacity
          *
          * @param fixedCapacity the capacity to be fixed for this list
@@ -930,7 +929,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
     }
 
     /**
-     * A creation method to build Markers
+     * A creation method to build Markers.
      *
      * @param initialFive list of initial five elements
      * @param p the quantile desired
@@ -969,7 +968,7 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
          * @return percentile value of the marker index passed
          * @throws OutOfRangeException in case the index is not within [1-5]
          */
-        double height(final int markerIndex);
+        double height(int markerIndex);
 
         /**
          * Process a data point by moving the marker heights based on estimator.
@@ -977,15 +976,15 @@ public class PSquarePercentile extends AbstractStorelessUnivariateStatistic
          * @param inputDataPoint is the data point passed
          * @return computed percentile
          */
-        double processDataPoint(final double inputDataPoint);
+        double processDataPoint(double inputDataPoint);
 
         /**
-         * An Estimate of the percentile value of a given Marker
+         * An Estimate of the percentile value of a given Marker.
          *
          * @param index the marker's index in the array of markers
          * @return percentile estimate
          * @throws OutOfRangeException in case if index is not within [1-5]
          */
-        double estimate(final int index);
+        double estimate(int index);
     }
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java
index 301c74b..61c5dc5 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/Percentile.java
@@ -91,22 +91,22 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  * <code>clear()</code> method, it must be synchronized externally.</p>
  */
 public class Percentile extends AbstractUnivariateStatistic implements Serializable {
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
     /** Maximum number of partitioning pivots cached (each level double the number of pivots). */
     private static final int MAX_CACHED_LEVELS = 10;
 
-    /** Maximum number of cached pivots in the pivots cached array */
+    /** Maximum number of cached pivots in the pivots cached array. */
     private static final int PIVOTS_HEAP_LENGTH = 0x1 << MAX_CACHED_LEVELS - 1;
 
-    /** Default KthSelector used with default pivoting strategy */
+    /** Default KthSelector used with default pivoting strategy. */
     private final KthSelector kthSelector;
 
     /** Any of the {@link EstimationType}s such as {@link EstimationType#LEGACY CM} can be used. */
     private final EstimationType estimationType;
 
-    /** NaN Handling of the input as defined by {@link NaNStrategy} */
+    /** NaN Handling of the input as defined by {@link NaNStrategy}. */
     private final NaNStrategy nanStrategy;
 
     /**
@@ -118,7 +118,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
     /** Cached pivots. */
     private int[] cachedPivots;
 
-    /** Weights*/
+    /** Weight. */
     private double[] weights;
     /**
      * Constructs a Percentile with the following defaults.
@@ -138,7 +138,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
     }
 
     /**
-     * Constructs a Percentile with the specific quantile value and the following
+     * Constructs a Percentile with the specific quantile value and the following.
      * <ul>
      *   <li>default method type: {@link EstimationType#LEGACY}</li>
      *   <li>default NaN strategy: {@link NaNStrategy#REMOVED}</li>
@@ -154,7 +154,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
     }
 
     /**
-     * Copy constructor, creates a new {@code Percentile} identical
+     * Copy constructor, creates a new {@code Percentile} identical.
      * to the {@code original}
      *
      * @param original the {@code Percentile} instance to copy.
@@ -273,12 +273,12 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         cachedPivots = new int[PIVOTS_HEAP_LENGTH];
         Arrays.fill(cachedPivots, -1);
 
-        /** Check length */
+        // Check length
         if (values.length != sampleWeights.length) {
             throw new MathIllegalArgumentException(LocalizedFormats.LENGTH,
                                                    values, sampleWeights);
         }
-        /** Check weights > 0 */
+        // Check weights > 0
         MathArrays.checkPositive(sampleWeights);
         MathArrays.checkNotNaN(sampleWeights);
 
@@ -488,7 +488,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         if (values == null || sampleWeights == null) {
             throw new MathIllegalArgumentException(LocalizedFormats.NULL_NOT_ALLOWED);
         }
-        /** Check length */
+        // Check length
         if (values.length != sampleWeights.length) {
             throw new MathIllegalArgumentException(LocalizedFormats.LENGTH,
                                                    values, sampleWeights);
@@ -615,7 +615,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         return work;
     }
     /**
-     * Make a copy of the array for the slice defined by array part from
+     * Make a copy of the array for the slice defined by array part from.
      * [begin, begin+length)
      * @param values the input array
      * @param begin start index of the array to include
@@ -704,7 +704,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         return temp;
     }
     /**
-     * Remove weights element if the corresponding data is equal to the given value
+     * Remove weights element if the corresponding data is equal to the given value.
      * in [begin, begin+length)
      *
      * @param values the input array
@@ -752,7 +752,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         return temp;
     }
     /**
-     * Get pivots which is either cached or a newly created one
+     * Get pivots which is either cached or a newly created one.
      *
      * @param values array containing the input numbers
      * @return cached pivots or a newly created one
@@ -914,7 +914,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
      */
     public enum EstimationType {
         /**
-         * This is the default type used in the {@link Percentile}.This method
+         * This is the default type used in the {@link Percentile}.This method.
          * has the following formulae for index and estimates<br>
          * \( \begin{align}
          * &amp;index    = (N+1)p\ \\
@@ -943,7 +943,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_1 has the following formulae for index and estimates<br>
+         * The method R_1 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= Np + 1/2\,  \\
          * &amp;estimate= x_{\lceil h\,-\,1/2 \rceil} \\
@@ -974,7 +974,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_2 has the following formulae for index and estimates<br>
+         * The method R_2 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= Np + 1/2\, \\
          * &amp;estimate=\frac{x_{\lceil h\,-\,1/2 \rceil} +
@@ -1014,7 +1014,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_3 has the following formulae for index and estimates<br>
+         * The method R_3 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= Np \\
          * &amp;estimate= x_{\lfloor h \rceil}\, \\
@@ -1035,7 +1035,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_4 has the following formulae for index and estimates<br>
+         * The method R_4 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= Np\, \\
          * &amp;estimate= x_{\lfloor h \rfloor} + (h -
@@ -1060,7 +1060,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_5 has the following formulae for index and estimates<br>
+         * The method R_5 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= Np + 1/2\\
          * &amp;estimate= x_{\lfloor h \rfloor} + (h -
@@ -1087,7 +1087,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         },
         /**
-         * The method R_6 has the following formulae for index and estimates<br>
+         * The method R_6 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index= (N + 1)p \\
          * &amp;estimate= x_{\lfloor h \rfloor} + (h -
@@ -1174,7 +1174,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         },
 
         /**
-         * The method R_8 has the following formulae for index and estimates<br>
+         * The method R_8 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index = (N + 1/3)p + 1/3  \\
          * &amp;estimate = x_{\lfloor h \rfloor} + (h -
@@ -1205,7 +1205,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         },
 
         /**
-         * The method R_9 has the following formulae for index and estimates<br>
+         * The method R_9 has the following formulae for index and estimates.<br>
          * \( \begin{align}
          * &amp;index = (N + 1/4)p + 3/8\\
          * &amp;estimate = x_{\lfloor h \rfloor} + (h -
@@ -1236,7 +1236,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
         private final String name;
 
         /**
-         * Constructor
+         * Constructor.
          *
          * @param type name of estimation type as per wikipedia
          */
@@ -1254,7 +1254,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
          * @param length the total number of array elements in the work array
          * @return a computed real valued index as explained in the wikipedia
          */
-        protected abstract double index(final double p, final int length);
+        protected abstract double index(double p, int length);
 
         /**
          * Estimation based on K<sup>th</sup> selection. This may be overridden
@@ -1338,8 +1338,8 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
          * @return estimated weighted percentile
          * @throws MathIllegalArgumentException if weighted percentile is not supported by the current estimationType
          */
-        public abstract double evaluate(final double[] work, final double[] sampleWeights,
-                                        final double p);
+        public abstract double evaluate(double[] work, double[] sampleWeights,
+                                        double p);
         /**
          * Search the interval q*sn locates in.
          * @param qsn q*sn, where n refers to the data size
@@ -1369,7 +1369,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
             }
         }
         /**
-         * Gets the name of the enum
+         * Gets the name of the enum.
          *
          * @return the name
          */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategy.java
index ef1e319..2190502 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PivotingStrategy.java
@@ -27,7 +27,7 @@ package org.apache.commons.math4.legacy.stat.descriptive.rank;
 public interface PivotingStrategy {
     /**
      * Find pivot index of the array so that partition and K<sup>th</sup>
-     * element selection can be made
+     * element selection can be made.
      * @param work data array
      * @param begin index of the first element of the slice
      * @param end index after the last element of the slice
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
index 70efe5f..7415afd 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/rank/RandomPivotingStrategy.java
@@ -20,7 +20,6 @@ import java.io.Serializable;
 import java.io.IOException;
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
-import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;
 import org.apache.commons.math4.legacy.core.MathArrays;
 import org.apache.commons.rng.RestorableUniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
@@ -60,7 +59,7 @@ public class RandomPivotingStrategy implements PivotingStrategy, Serializable {
      *
      * @return The index corresponding to a random uniformly selected
      * value between first and the last indices of the array slice
-     * @throws MathIllegalArgumentException when indices exceeds range
+     * @throws org.apache.commons.math4.legacy.exception.MathIllegalArgumentException MathIllegalArgumentException when indices exceeds range
      */
     @Override
     public int pivotIndex(final double[] work, final int begin, final int end) {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Product.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Product.java
index cd697fe..54aae6d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Product.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Product.java
@@ -39,10 +39,10 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Product extends AbstractStorelessUnivariateStatistic implements Serializable, WeightedEvaluation {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /**The number of values that have been added */
+    /**The number of values that have been added. */
     private long n;
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Sum.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Sum.java
index ecb102b..60e3886 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Sum.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/Sum.java
@@ -38,7 +38,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class Sum extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
     /** */
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfLogs.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfLogs.java
index 1b8832a..6d77f7c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfLogs.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfLogs.java
@@ -46,14 +46,14 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class SumOfLogs extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Number of values that have been added */
+    /** Number of values that have been added. */
     private int n;
 
     /**
-     * The currently running value
+     * The currently running value.
      */
     private double value;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfSquares.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfSquares.java
index f1c15fd..f439b5c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfSquares.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/descriptive/summary/SumOfSquares.java
@@ -37,14 +37,14 @@ import org.apache.commons.math4.legacy.core.MathArrays;
  */
 public class SumOfSquares extends AbstractStorelessUnivariateStatistic implements Serializable {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = 20150412L;
 
-    /** Number of values that have been added */
+    /** Number of values that have been added. */
     private long n;
 
     /**
-     * The currently running sumSq
+     * The currently running sumSq.
      */
     private double value;
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/ChiSquareTest.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/ChiSquareTest.java
index ee6f4fa..42504eb 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/ChiSquareTest.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/ChiSquareTest.java
@@ -41,7 +41,7 @@ import org.apache.commons.math4.legacy.core.MathArrays;
 public class ChiSquareTest {
 
     /**
-     * Construct a ChiSquareTest
+     * Construct a ChiSquareTest.
      */
     public ChiSquareTest() {
         super();
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/GTest.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/GTest.java
index 666f2ea..baaefb3 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/GTest.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/GTest.java
@@ -259,17 +259,17 @@ public class GTest {
      */
     private double entropy(final long[][] k) {
         double h = 0d;
-        double sum_k = 0d;
+        double sumK = 0d;
         for (int i = 0; i < k.length; i++) {
             for (int j = 0; j < k[i].length; j++) {
-                sum_k += (double) k[i][j];
+                sumK += (double) k[i][j];
             }
         }
         for (int i = 0; i < k.length; i++) {
             for (int j = 0; j < k[i].length; j++) {
                 if (k[i][j] != 0) {
-                    final double p_ij = (double) k[i][j] / sum_k;
-                    h += p_ij * AccurateMath.log(p_ij);
+                    final double pIJ = (double) k[i][j] / sumK;
+                    h += pIJ * AccurateMath.log(pIJ);
                 }
             }
         }
@@ -289,14 +289,14 @@ public class GTest {
      */
     private double entropy(final long[] k) {
         double h = 0d;
-        double sum_k = 0d;
+        double sumK = 0d;
         for (int i = 0; i < k.length; i++) {
-            sum_k += (double) k[i];
+            sumK += (double) k[i];
         }
         for (int i = 0; i < k.length; i++) {
             if (k[i] != 0) {
-                final double p_i = (double) k[i] / sum_k;
-                h += p_i * AccurateMath.log(p_i);
+                final double pI = (double) k[i] / sumK;
+                h += pI * AccurateMath.log(pI);
             }
         }
         return -h;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/InferenceTestUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/InferenceTestUtils.java
index 7ba488c..5929c58 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/InferenceTestUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/InferenceTestUtils.java
@@ -39,7 +39,7 @@ import org.apache.commons.math4.legacy.stat.descriptive.StatisticalSummary;
  *
  * @since 1.1
  */
-public class InferenceTestUtils {
+public final class InferenceTestUtils {
 
     /** Singleton TTest instance. */
     private static final TTest T_TEST = new TTest();
@@ -53,7 +53,7 @@ public class InferenceTestUtils {
     /** Singleton G-Test instance. */
     private static final GTest G_TEST = new GTest();
 
-    /** Singleton K-S test instance */
+    /** Singleton K-S test instance. */
     private static final KolmogorovSmirnovTest KS_TEST = new KolmogorovSmirnovTest();
 
     /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
index 09fcb0f..4dc003b 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/KolmogorovSmirnovTest.java
@@ -114,14 +114,14 @@ public class KolmogorovSmirnovTest {
     /** pi^2. */
     private static final double PI_SQUARED = AccurateMath.PI * AccurateMath.PI;
     /**
-     * Bound on the number of partial sums in {@link #ksSum(double, double, int)}
+     * Bound on the number of partial sums in {@link #ksSum(double, double, int)}.
      */
     private static final int MAXIMUM_PARTIAL_SUM_COUNT = 100000;
-    /** Convergence criterion for {@link #ksSum(double, double, int)} */
+    /** Convergence criterion for {@link #ksSum(double, double, int)}. */
     private static final double KS_SUM_CAUCHY_CRITERION = 1e-20;
-    /** Convergence criterion for the sums in {@link #pelzGood(double, int)} */
+    /** Convergence criterion for the sums in {@link #pelzGood(double, int)}. */
     private static final double PG_SUM_RELATIVE_ERROR = 1e-10;
-    /** 1/2 */
+    /** 1/2. */
     private static final BigFraction ONE_HALF = BigFraction.of(1, 2);
 
     /**
@@ -285,10 +285,10 @@ public class KolmogorovSmirnovTest {
 
         int rankX = 0;
         int rankY = 0;
-        long curD = 0l;
+        long curD = 0L;
 
         // Find the max difference between cdf_x and cdf_y
-        long supD = 0l;
+        long supD = 0L;
         do {
             double z = Double.compare(sx[rankX], sy[rankY]) <= 0 ? sx[rankX] : sy[rankY];
             while(rankX < n && Double.compare(sx[rankX], z) == 0) {
@@ -301,8 +301,7 @@ public class KolmogorovSmirnovTest {
             }
             if (curD > supD) {
                 supD = curD;
-            }
-            else if (-curD > supD) {
+            } else if (-curD > supD) {
                 supD = -curD;
             }
         } while(rankX < n && rankY < m);
@@ -489,16 +488,16 @@ public class KolmogorovSmirnovTest {
     private double exactK(double d, int n) {
         final int k = (int) Math.ceil(n * d);
 
-        final FieldDenseMatrix<BigFraction> H;
+        final FieldDenseMatrix<BigFraction> h;
         try {
-            H = createExactH(d, n);
+            h = createExactH(d, n);
         } catch (ArithmeticException e) {
             throw new MathArithmeticException(LocalizedFormats.FRACTION);
         }
 
-        final FieldDenseMatrix<BigFraction> Hpower = H.pow(n);
+        final FieldDenseMatrix<BigFraction> hPower = h.pow(n);
 
-        BigFraction pFrac = Hpower.get(k - 1, k - 1);
+        BigFraction pFrac = hPower.get(k - 1, k - 1);
 
         for (int i = 1; i <= n; ++i) {
             pFrac = pFrac.multiply(i).divide(n);
@@ -522,10 +521,10 @@ public class KolmogorovSmirnovTest {
     private double roundedK(double d, int n) {
 
         final int k = (int) Math.ceil(n * d);
-        final RealMatrix H = this.createRoundedH(d, n);
-        final RealMatrix Hpower = H.power(n);
+        final RealMatrix h = this.createRoundedH(d, n);
+        final RealMatrix hPower = h.power(n);
 
-        double pFrac = Hpower.getEntry(k - 1, k - 1);
+        double pFrac = hPower.getEntry(k - 1, k - 1);
         for (int i = 1; i <= n; ++i) {
             pFrac *= (double) i / (double) n;
         }
@@ -701,7 +700,7 @@ public class KolmogorovSmirnovTest {
                 h = BigFraction.from(hDouble, 1e-5, 10000);
             }
         }
-        final FieldDenseMatrix<BigFraction> Hdata = FieldDenseMatrix.create(BigFractionField.get(), m, m);
+        final FieldDenseMatrix<BigFraction> hData = FieldDenseMatrix.create(BigFractionField.get(), m, m);
 
         /*
          * Start by filling everything with either 0 or 1.
@@ -709,9 +708,9 @@ public class KolmogorovSmirnovTest {
         for (int i = 0; i < m; ++i) {
             for (int j = 0; j < m; ++j) {
                 if (i - j + 1 < 0) {
-                    Hdata.set(i, j, BigFraction.ZERO);
+                    hData.set(i, j, BigFraction.ZERO);
                 } else {
-                    Hdata.set(i, j, BigFraction.ONE);
+                    hData.set(i, j, BigFraction.ONE);
                 }
             }
         }
@@ -730,10 +729,10 @@ public class KolmogorovSmirnovTest {
          * First column and last row has special values (each other reversed).
          */
         for (int i = 0; i < m; ++i) {
-            Hdata.set(i, 0,
-                      Hdata.get(i, 0).subtract(hPowers[i]));
-            Hdata.set(m - 1, i,
-                      Hdata.get(m - 1, i).subtract(hPowers[m - i - 1]));
+            hData.set(i, 0,
+                      hData.get(i, 0).subtract(hPowers[i]));
+            hData.set(m - 1, i,
+                      hData.get(m - 1, i).subtract(hPowers[m - i - 1]));
         }
 
         /*
@@ -741,8 +740,8 @@ public class KolmogorovSmirnovTest {
          * (2h - 1)^m )/m!" Since 0 <= h < 1, then if h > 1/2 is sufficient to check:
          */
         if (h.compareTo(ONE_HALF) > 0) {
-            Hdata.set(m - 1, 0,
-                      Hdata.get(m - 1, 0).add(h.multiply(2).subtract(1).pow(m)));
+            hData.set(m - 1, 0,
+                      hData.get(m - 1, 0).add(h.multiply(2).subtract(1).pow(m)));
         }
 
         /*
@@ -757,13 +756,13 @@ public class KolmogorovSmirnovTest {
             for (int j = 0; j < i + 1; ++j) {
                 if (i - j + 1 > 0) {
                     for (int g = 2; g <= i - j + 1; ++g) {
-                        Hdata.set(i, j,
-                                  Hdata.get(i, j).divide(g));
+                        hData.set(i, j,
+                                  hData.get(i, j).divide(g));
                     }
                 }
             }
         }
-        return Hdata;
+        return hData;
     }
 
     /***
@@ -784,7 +783,7 @@ public class KolmogorovSmirnovTest {
         if (h >= 1) {
             throw new NumberIsTooLargeException(h, 1.0, false);
         }
-        final double[][] Hdata = new double[m][m];
+        final double[][] hData = new double[m][m];
 
         /*
          * Start by filling everything with either 0 or 1.
@@ -792,9 +791,9 @@ public class KolmogorovSmirnovTest {
         for (int i = 0; i < m; ++i) {
             for (int j = 0; j < m; ++j) {
                 if (i - j + 1 < 0) {
-                    Hdata[i][j] = 0;
+                    hData[i][j] = 0;
                 } else {
-                    Hdata[i][j] = 1;
+                    hData[i][j] = 1;
                 }
             }
         }
@@ -813,8 +812,8 @@ public class KolmogorovSmirnovTest {
          * First column and last row has special values (each other reversed).
          */
         for (int i = 0; i < m; ++i) {
-            Hdata[i][0] = Hdata[i][0] - hPowers[i];
-            Hdata[m - 1][i] -= hPowers[m - i - 1];
+            hData[i][0] = hData[i][0] - hPowers[i];
+            hData[m - 1][i] -= hPowers[m - i - 1];
         }
 
         /*
@@ -822,7 +821,7 @@ public class KolmogorovSmirnovTest {
          * (2h - 1)^m )/m!" Since 0 <= h < 1, then if h > 1/2 is sufficient to check:
          */
         if (Double.compare(h, 0.5) > 0) {
-            Hdata[m - 1][0] += AccurateMath.pow(2 * h - 1, m);
+            hData[m - 1][0] += AccurateMath.pow(2 * h - 1, m);
         }
 
         /*
@@ -837,12 +836,12 @@ public class KolmogorovSmirnovTest {
             for (int j = 0; j < i + 1; ++j) {
                 if (i - j + 1 > 0) {
                     for (int g = 2; g <= i - j + 1; ++g) {
-                        Hdata[i][j] /= g;
+                        hData[i][j] /= g;
                     }
                 }
             }
         }
-        return MatrixUtils.createRealMatrix(Hdata);
+        return MatrixUtils.createRealMatrix(hData);
     }
 
     /**
@@ -918,9 +917,8 @@ public class KolmogorovSmirnovTest {
         long upperBound = (long)AccurateMath.ceil((d - tol) * nm);
         long lowerBound = (long)AccurateMath.floor((d + tol) * nm);
         if (strict && lowerBound == upperBound) {
-            return upperBound + 1l;
-        }
-        else {
+            return upperBound + 1L;
+        } else {
             return upperBound;
         }
     }
@@ -1048,7 +1046,7 @@ public class KolmogorovSmirnovTest {
         final boolean b[] = new boolean[sum];
         for (int i = 0; i < iterations; i++) {
             fillBooleanArrayRandomlyWithFixedNumberTrueValues(b, nn, rng);
-            long curD = 0l;
+            long curD = 0L;
             for(int j = 0; j < b.length; ++j) {
                 if (b[j]) {
                     curD += mm;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/MannWhitneyUTest.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/MannWhitneyUTest.java
index 15d80e8..be14563 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/MannWhitneyUTest.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/MannWhitneyUTest.java
@@ -143,18 +143,18 @@ public class MannWhitneyUTest {
          * U1 = R1 - (n1 * (n1 + 1)) / 2 where R1 is sum of ranks for sample 1,
          * e.g. x, n1 is the number of observations in sample 1.
          */
-        final double U1 = sumRankX - ((long) x.length * (x.length + 1)) / 2;
+        final double u1 = sumRankX - ((long) x.length * (x.length + 1)) / 2;
 
         /*
          * It can be shown that U1 + U2 = n1 * n2
          */
-        final double U2 = (long) x.length * y.length - U1;
+        final double u2 = (long) x.length * y.length - u1;
 
-        return AccurateMath.min(U1, U2);
+        return AccurateMath.min(u1, u2);
     }
 
     /**
-     * @param Umin smallest Mann-Whitney U value
+     * @param umin smallest Mann-Whitney U value
      * @param n1 number of subjects in first sample
      * @param n2 number of subjects in second sample
      * @return two-sided asymptotic p-value
@@ -163,7 +163,7 @@ public class MannWhitneyUTest {
      * @throws MaxCountExceededException if the maximum number of
      * iterations is exceeded
      */
-    private double calculateAsymptoticPValue(final double Umin,
+    private double calculateAsymptoticPValue(final double umin,
                                              final int n1,
                                              final int n2)
         throws ConvergenceException, MaxCountExceededException {
@@ -174,10 +174,10 @@ public class MannWhitneyUTest {
         final long n1n2prod = (long) n1 * n2;
 
         // http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U#Normal_approximation
-        final double EU = n1n2prod / 2.0;
-        final double VarU = n1n2prod * (n1 + n2 + 1) / 12.0;
+        final double eU = n1n2prod / 2.0;
+        final double varU = n1n2prod * (n1 + n2 + 1) / 12.0;
 
-        final double z = (Umin - EU) / AccurateMath.sqrt(VarU);
+        final double z = (umin - eU) / AccurateMath.sqrt(varU);
 
         // No try-catch or advertised exception because args are valid
         // pass a null rng to avoid unneeded overhead as we will not sample from this distribution
@@ -223,8 +223,8 @@ public class MannWhitneyUTest {
 
         ensureDataConformance(x, y);
 
-        final double Umin = mannWhitneyU(x, y);
+        final double uMin = mannWhitneyU(x, y);
 
-        return calculateAsymptoticPValue(Umin, x.length, y.length);
+        return calculateAsymptoticPValue(uMin, x.length, y.length);
     }
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/OneWayAnova.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/OneWayAnova.java
index 192c13f..e76cb20 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/OneWayAnova.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/OneWayAnova.java
@@ -87,7 +87,7 @@ public class OneWayAnova {
         throws NullArgumentException, DimensionMismatchException {
 
         AnovaStats a = anovaStats(categoryData);
-        return a.F;
+        return a.f;
 
     }
 
@@ -127,7 +127,7 @@ public class OneWayAnova {
         // No try-catch or advertised exception because args are valid
         // pass a null rng to avoid unneeded overhead as we will not sample from this distribution
         final FDistribution fdist = new FDistribution(a.dfbg, a.dfwg);
-        return 1.0 - fdist.cumulativeProbability(a.F);
+        return 1.0 - fdist.cumulativeProbability(a.f);
 
     }
 
@@ -169,7 +169,7 @@ public class OneWayAnova {
         final AnovaStats a = anovaStats(categoryData, allowOneElementData);
         // pass a null rng to avoid unneeded overhead as we will not sample from this distribution
         final FDistribution fdist = new FDistribution(a.dfbg, a.dfwg);
-        return 1.0 - fdist.cumulativeProbability(a.F);
+        return 1.0 - fdist.cumulativeProbability(a.f);
 
     }
 
@@ -248,7 +248,7 @@ public class OneWayAnova {
         throws NullArgumentException, DimensionMismatchException,
         OutOfRangeException, ConvergenceException, MaxCountExceededException {
 
-        if ((alpha <= 0) || (alpha > 0.5)) {
+        if (alpha <= 0 || alpha > 0.5) {
             throw new OutOfRangeException(
                     LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
                     alpha, 0, 0.5);
@@ -317,9 +317,9 @@ public class OneWayAnova {
         final int dfbg = categoryData.size() - 1;
         final double msbg = ssbg / dfbg;
         final double mswg = sswg / dfwg;
-        final double F = msbg / mswg;
+        final double f = msbg / mswg;
 
-        return new AnovaStats(dfbg, dfwg, F);
+        return new AnovaStats(dfbg, dfwg, f);
 
     }
 
@@ -327,7 +327,7 @@ public class OneWayAnova {
         Convenience class to pass dfbg,dfwg,F values around within OneWayAnova.
         No get/set methods provided.
     */
-    private static class AnovaStats {
+    private static final class AnovaStats {
 
         /** Degrees of freedom in numerator (between groups). */
         private final int dfbg;
@@ -336,18 +336,18 @@ public class OneWayAnova {
         private final int dfwg;
 
         /** Statistic. */
-        private final double F;
+        private final double f;
 
         /**
-         * Constructor
+         * Constructor.
          * @param dfbg degrees of freedom in numerator (between groups)
          * @param dfwg degrees of freedom in denominator (within groups)
-         * @param F statistic
+         * @param f statistic
          */
-        private AnovaStats(int dfbg, int dfwg, double F) {
+        private AnovaStats(int dfbg, int dfwg, double f) {
             this.dfbg = dfbg;
             this.dfwg = dfwg;
-            this.F = F;
+            this.f = f;
         }
     }
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/WilcoxonSignedRankTest.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/WilcoxonSignedRankTest.java
index 1146e56..8d7141d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/WilcoxonSignedRankTest.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/inference/WilcoxonSignedRankTest.java
@@ -88,7 +88,7 @@ public class WilcoxonSignedRankTest {
     }
 
     /**
-     * Calculates y[i] - x[i] for all i
+     * Calculates y[i] - x[i] for all i.
      *
      * @param x first sample
      * @param y second sample
@@ -106,7 +106,7 @@ public class WilcoxonSignedRankTest {
     }
 
     /**
-     * Calculates |z[i]| for all i
+     * Calculates |z[i]| for all i.
      *
      * @param z sample
      * @return |z|
@@ -179,34 +179,34 @@ public class WilcoxonSignedRankTest {
 
         final double[] ranks = naturalRanking.rank(zAbs);
 
-        double Wplus = 0;
+        double wPlus = 0;
 
         for (int i = 0; i < z.length; ++i) {
             if (z[i] > 0) {
-                Wplus += ranks[i];
+                wPlus += ranks[i];
             }
         }
 
-        final int N = x.length;
-        final double Wminus = (((double) (N * (N + 1))) / 2.0) - Wplus;
+        final int n = x.length;
+        final double wMinus = (((double) (n * (n + 1))) / 2.0) - wPlus;
 
-        return AccurateMath.max(Wplus, Wminus);
+        return AccurateMath.max(wPlus, wMinus);
     }
 
     /**
-     * Algorithm inspired by
+     * Algorithm inspired by.
      * http://www.fon.hum.uva.nl/Service/Statistics/Signed_Rank_Algorihms.html#C
      * by Rob van Son, Institute of Phonetic Sciences & IFOTT,
      * University of Amsterdam
      *
-     * @param Wmax largest Wilcoxon signed rank value
-     * @param N number of subjects (corresponding to x.length)
+     * @param wMax largest Wilcoxon signed rank value
+     * @param n number of subjects (corresponding to x.length)
      * @return two-sided exact p-value
      */
-    private double calculateExactPValue(final double Wmax, final int N) {
+    private double calculateExactPValue(final double wMax, final int n) {
 
         // Total number of outcomes (equal to 2^N but a lot faster)
-        final int m = 1 << N;
+        final int m = 1 << n;
 
         int largerRankSums = 0;
 
@@ -214,7 +214,7 @@ public class WilcoxonSignedRankTest {
             int rankSum = 0;
 
             // Generate all possible rank sums
-            for (int j = 0; j < N; ++j) {
+            for (int j = 0; j < n; ++j) {
 
                 // (i >> j) & 1 extract i's j-th bit from the right
                 if (((i >> j) & 1) == 1) {
@@ -222,7 +222,7 @@ public class WilcoxonSignedRankTest {
                 }
             }
 
-            if (rankSum >= Wmax) {
+            if (rankSum >= wMax) {
                 ++largerRankSums;
             }
         }
@@ -235,21 +235,21 @@ public class WilcoxonSignedRankTest {
     }
 
     /**
-     * @param Wmin smallest Wilcoxon signed rank value
-     * @param N number of subjects (corresponding to x.length)
+     * @param wMin smallest Wilcoxon signed rank value
+     * @param n number of subjects (corresponding to x.length)
      * @return two-sided asymptotic p-value
      */
-    private double calculateAsymptoticPValue(final double Wmin, final int N) {
+    private double calculateAsymptoticPValue(final double wMin, final int n) {
 
-        final double ES = (double) (N * (N + 1)) / 4.0;
+        final double es = (double) (n * (n + 1)) / 4.0;
 
         /* Same as (but saves computations):
          * final double VarW = ((double) (N * (N + 1) * (2*N + 1))) / 24;
          */
-        final double VarS = ES * ((double) (2 * N + 1) / 6.0);
+        final double varS = es * ((double) (2 * n + 1) / 6.0);
 
         // - 0.5 is a continuity correction
-        final double z = (Wmin - ES - 0.5) / AccurateMath.sqrt(VarS);
+        final double z = (wMin - es - 0.5) / AccurateMath.sqrt(varS);
 
         // No try-catch or advertised exception because args are valid
         // pass a null rng to avoid unneeded overhead as we will not sample from this distribution
@@ -306,18 +306,18 @@ public class WilcoxonSignedRankTest {
 
         ensureDataConformance(x, y);
 
-        final int N = x.length;
-        final double Wmax = wilcoxonSignedRank(x, y);
+        final int n = x.length;
+        final double wMax = wilcoxonSignedRank(x, y);
 
-        if (exactPValue && N > 30) {
-            throw new NumberIsTooLargeException(N, 30, true);
+        if (exactPValue && n > 30) {
+            throw new NumberIsTooLargeException(n, 30, true);
         }
 
         if (exactPValue) {
-            return calculateExactPValue(Wmax, N);
+            return calculateExactPValue(wMax, n);
         } else {
-            final double Wmin = ( (double)(N*(N+1)) / 2.0 ) - Wmax;
-            return calculateAsymptoticPValue(Wmin, N);
+            final double wMin = ( (double)(n*(n+1)) / 2.0 ) - wMax;
+            return calculateAsymptoticPValue(wMin, n);
         }
     }
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/interval/ConfidenceInterval.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/interval/ConfidenceInterval.java
index 19d2086..acd3af6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/interval/ConfidenceInterval.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/interval/ConfidenceInterval.java
@@ -26,14 +26,14 @@ import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
  */
 public class ConfidenceInterval {
 
-    /** Lower endpoint of the interval */
+    /** Lower endpoint of the interval. */
     private double lowerBound;
 
-    /** Upper endpoint of the interval */
+    /** Upper endpoint of the interval. */
     private double upperBound;
 
     /**
-     * The asserted probability that the interval contains the population
+     * The asserted probability that the interval contains the population.
      * parameter
      */
     private double confidenceLevel;
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaNStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaNStrategy.java
index eda3629..af87c26 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaNStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaNStrategy.java
@@ -36,19 +36,19 @@ package org.apache.commons.math4.legacy.stat.ranking;
  */
 public enum NaNStrategy {
 
-    /** NaNs are considered minimal in the ordering */
+    /** NaNs are considered minimal in the ordering. */
     MINIMAL,
 
-    /** NaNs are considered maximal in the ordering */
+    /** NaNs are considered maximal in the ordering. */
     MAXIMAL,
 
-    /** NaNs are removed before computing ranks */
+    /** NaNs are removed before computing ranks. */
     REMOVED,
 
-    /** NaNs are left in place */
+    /** NaNs are left in place. */
     FIXED,
 
-    /** NaNs result in an exception
+    /** NaNs result in an exception.
      * @since 3.1
      */
     FAILED
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
index bbab5ea..627dfaf 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/NaturalRanking.java
@@ -72,19 +72,19 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class NaturalRanking implements RankingAlgorithm {
 
-    /** default NaN strategy */
+    /** default NaN strategy. */
     public static final NaNStrategy DEFAULT_NAN_STRATEGY = NaNStrategy.FAILED;
 
-    /** default ties strategy */
+    /** default ties strategy. */
     public static final TiesStrategy DEFAULT_TIES_STRATEGY = TiesStrategy.AVERAGE;
 
-    /** NaN strategy - defaults to NaNs maximal */
+    /** NaN strategy - defaults to NaNs maximal. */
     private final NaNStrategy nanStrategy;
 
-    /** Ties strategy - defaults to ties averaged */
+    /** Ties strategy - defaults to ties averaged. */
     private final TiesStrategy tiesStrategy;
 
-    /** Source of random data - used only when ties strategy is RANDOM */
+    /** Source of random data - used only when ties strategy is RANDOM. */
     private final RandomUtils.DataGenerator randomData;
 
     /**
@@ -163,7 +163,7 @@ public class NaturalRanking implements RankingAlgorithm {
     }
 
     /**
-     * Return the NaNStrategy
+     * Return the NaNStrategy.
      *
      * @return returns the NaNStrategy
      */
@@ -172,7 +172,7 @@ public class NaturalRanking implements RankingAlgorithm {
     }
 
     /**
-     * Return the TiesStrategy
+     * Return the TiesStrategy.
      *
      * @return the TiesStrategy
      */
@@ -429,10 +429,10 @@ public class NaturalRanking implements RankingAlgorithm {
      */
     private static class IntDoublePair implements Comparable<IntDoublePair>  {
 
-        /** Value of the pair */
+        /** Value of the pair. */
         private final double value;
 
-        /** Original position of the pair */
+        /** Original position of the pair. */
         private final int position;
 
         /**
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/TiesStrategy.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/TiesStrategy.java
index 7f51825..63e9a3c 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/TiesStrategy.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/ranking/TiesStrategy.java
@@ -37,18 +37,18 @@ package org.apache.commons.math4.legacy.stat.ranking;
  */
 public enum TiesStrategy {
 
-    /** Ties assigned sequential ranks in order of occurrence */
+    /** Ties assigned sequential ranks in order of occurrence. */
     SEQUENTIAL,
 
-    /** Ties get the minimum applicable rank */
+    /** Ties get the minimum applicable rank. */
     MINIMUM,
 
-    /** Ties get the maximum applicable rank */
+    /** Ties get the maximum applicable rank. */
     MAXIMUM,
 
-    /** Ties get the average of applicable ranks */
+    /** Ties get the average of applicable ranks. */
     AVERAGE,
 
-    /** Ties get a random integral value from among applicable ranks */
+    /** Ties get a random integral value from among applicable ranks. */
     RANDOM
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/GLSMultipleLinearRegression.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/GLSMultipleLinearRegression.java
index d592914..d48b12f 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/GLSMultipleLinearRegression.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/GLSMultipleLinearRegression.java
@@ -42,10 +42,10 @@ import org.apache.commons.math4.legacy.linear.RealVector;
 public class GLSMultipleLinearRegression extends AbstractMultipleLinearRegression {
 
     /** Covariance matrix. */
-    private RealMatrix Omega;
+    private RealMatrix omega;
 
     /** Inverse of covariance matrix. */
-    private RealMatrix OmegaInverse;
+    private RealMatrix omegaInverse;
 
     /** Replace sample data, overriding any previous sample.
      * @param y y values of the sample
@@ -66,8 +66,8 @@ public class GLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
      * @param omega the [n,n] array representing the covariance
      */
     protected void newCovarianceData(double[][] omega){
-        this.Omega = new Array2DRowRealMatrix(omega);
-        this.OmegaInverse = null;
+        this.omega = new Array2DRowRealMatrix(omega);
+        this.omegaInverse = null;
     }
 
     /**
@@ -76,10 +76,10 @@ public class GLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
      * @return inverse of the covariance
      */
     protected RealMatrix getOmegaInverse() {
-        if (OmegaInverse == null) {
-            OmegaInverse = new LUDecomposition(Omega).getSolver().getInverse();
+        if (omegaInverse == null) {
+            omegaInverse = new LUDecomposition(omega).getSolver().getInverse();
         }
-        return OmegaInverse;
+        return omegaInverse;
     }
 
     /**
@@ -91,11 +91,11 @@ public class GLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
      */
     @Override
     protected RealVector calculateBeta() {
-        RealMatrix OI = getOmegaInverse();
-        RealMatrix XT = getX().transpose();
-        RealMatrix XTOIX = XT.multiply(OI).multiply(getX());
-        RealMatrix inverse = new LUDecomposition(XTOIX).getSolver().getInverse();
-        return inverse.multiply(XT).multiply(OI).operate(getY());
+        RealMatrix oi = getOmegaInverse();
+        RealMatrix xt = getX().transpose();
+        RealMatrix xtoix = xt.multiply(oi).multiply(getX());
+        RealMatrix inverse = new LUDecomposition(xtoix).getSolver().getInverse();
+        return inverse.multiply(xt).multiply(oi).operate(getY());
     }
 
     /**
@@ -107,9 +107,9 @@ public class GLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
      */
     @Override
     protected RealMatrix calculateBetaVariance() {
-        RealMatrix OI = getOmegaInverse();
-        RealMatrix XTOIX = getX().transpose().multiply(OI).multiply(getX());
-        return new LUDecomposition(XTOIX).getSolver().getInverse();
+        RealMatrix oi = getOmegaInverse();
+        RealMatrix xtoix = getX().transpose().multiply(oi).multiply(getX());
+        return new LUDecomposition(xtoix).getSolver().getInverse();
     }
 
 
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java
index 0267aa0..7adebc4 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java
@@ -41,46 +41,46 @@ import org.apache.commons.numbers.core.Precision;
  */
 public class MillerUpdatingRegression implements UpdatingMultipleLinearRegression {
 
-    /** number of variables in regression */
+    /** number of variables in regression. */
     private final int nvars;
-    /** diagonals of cross products matrix */
+    /** diagonals of cross products matrix. */
     private final double[] d;
-    /** the elements of the R`Y */
+    /** the elements of the R`Y. */
     private final double[] rhs;
-    /** the off diagonal portion of the R matrix */
+    /** the off diagonal portion of the R matrix. */
     private final double[] r;
-    /** the tolerance for each of the variables */
+    /** the tolerance for each of the variables. */
     private final double[] tol;
-    /** residual sum of squares for all nested regressions */
+    /** residual sum of squares for all nested regressions. */
     private final double[] rss;
-    /** order of the regressors */
+    /** order of the regressors. */
     private final int[] vorder;
-    /** scratch space for tolerance calc */
-    private final double[] work_tolset;
-    /** number of observations entered */
+    /** scratch space for tolerance calc. */
+    private final double[] workTolset;
+    /** number of observations entered. */
     private long nobs;
-    /** sum of squared errors of largest regression */
+    /** sum of squared errors of largest regression. */
     private double sserr;
     /** has rss been called? */
-    private boolean rss_set;
-    /** has the tolerance setting method been called */
-    private boolean tol_set;
-    /** flags for variables with linear dependency problems */
+    private boolean rssSet;
+    /** has the tolerance setting method been called. */
+    private boolean tolSet;
+    /** flags for variables with linear dependency problems. */
     private final boolean[] lindep;
-    /** singular x values */
-    private final double[] x_sing;
-    /** workspace for singularity method */
-    private final double[] work_sing;
-    /** summation of Y variable */
+    /** singular x values. */
+    private final double[] xSing;
+    /** workspace for singularity method. */
+    private final double[] workSing;
+    /** summation of Y variable. */
     private double sumy;
-    /** summation of squared Y values */
+    /** summation of squared Y values. */
     private double sumsqy;
-    /** boolean flag whether a regression constant is added */
+    /** boolean flag whether a regression constant is added. */
     private final boolean hasIntercept;
-    /** zero tolerance */
+    /** zero tolerance. */
     private final double epsilon;
     /**
-     *  Set the default constructor to private access
+     *  Set the default constructor to private access.
      *  to prevent inadvertent instantiation
      */
     @SuppressWarnings("unused")
@@ -114,9 +114,9 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         this.tol = new double[this.nvars];
         this.rss = new double[this.nvars];
         this.vorder = new int[this.nvars];
-        this.x_sing = new double[this.nvars];
-        this.work_sing = new double[this.nvars];
-        this.work_tolset = new double[this.nvars];
+        this.xSing = new double[this.nvars];
+        this.workSing = new double[this.nvars];
+        this.workTolset = new double[this.nvars];
         this.lindep = new boolean[this.nvars];
         for (int i = 0; i < this.nvars; i++) {
             vorder[i] = i;
@@ -195,7 +195,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
      */
     @Override
     public void addObservations(double[][] x, double[] y) throws ModelSpecificationException {
-        if ((x == null) || (y == null) || (x.length != y.length)) {
+        if (x == null || y == null || x.length != y.length) {
             throw new ModelSpecificationException(
                   LocalizedFormats.DIMENSIONS_MISMATCH_SIMPLE,
                   (x == null) ? 0 : x.length,
@@ -238,8 +238,8 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         double wxi;
         double dpi;
         double xk;
-        double _w;
-        this.rss_set = false;
+        double wPrev;
+        this.rssSet = false;
         sumy = smartAdd(yi, sumy);
         sumsqy = smartAdd(sumsqy, yi * yi);
         for (int i = 0; i < x.length; i++) {
@@ -254,7 +254,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             }
             di = d[i];
             wxi = w * xi;
-            _w = w;
+            wPrev = w;
             if (di != 0.0) {
                 dpi = smartAdd(di, wxi * xi);
                 final double tmp = wxi * xi / di;
@@ -270,7 +270,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
                 xk = x[k];
                 x[k] = smartAdd(xk, -xi * r[nextr]);
                 if (di != 0.0) {
-                    r[nextr] = smartAdd(di * r[nextr], (_w * xi) * xk) / dpi;
+                    r[nextr] = smartAdd(di * r[nextr], (wPrev * xi) * xk) / dpi;
                 } else {
                     r[nextr] = xk / xi;
                 }
@@ -295,17 +295,17 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
      * @return the sum of the a and b
      */
     private double smartAdd(double a, double b) {
-        final double _a = AccurateMath.abs(a);
-        final double _b = AccurateMath.abs(b);
-        if (_a > _b) {
-            final double eps = _a * Precision.EPSILON;
-            if (_b > eps) {
+        final double aa = AccurateMath.abs(a);
+        final double ba = AccurateMath.abs(b);
+        if (aa > ba) {
+            final double eps = aa * Precision.EPSILON;
+            if (ba > eps) {
                 return a + b;
             }
             return a;
         } else {
-            final double eps = _b * Precision.EPSILON;
-            if (_a > eps) {
+            final double eps = ba * Precision.EPSILON;
+            if (aa > eps) {
                 return a + b;
             }
             return b;
@@ -323,9 +323,9 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         Arrays.fill(this.r, 0.0);
         Arrays.fill(this.tol, 0.0);
         Arrays.fill(this.rss, 0.0);
-        Arrays.fill(this.work_tolset, 0.0);
-        Arrays.fill(this.work_sing, 0.0);
-        Arrays.fill(this.x_sing, 0.0);
+        Arrays.fill(this.workTolset, 0.0);
+        Arrays.fill(this.workSing, 0.0);
+        Arrays.fill(this.xSing, 0.0);
         Arrays.fill(this.lindep, false);
         for (int i = 0; i < nvars; i++) {
             this.vorder[i] = i;
@@ -334,8 +334,8 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         this.sserr = 0.0;
         this.sumy = 0.0;
         this.sumsqy = 0.0;
-        this.rss_set = false;
-        this.tol_set = false;
+        this.rssSet = false;
+        this.tolSet = false;
     }
 
     /**
@@ -346,19 +346,19 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         double total;
         final double eps = this.epsilon;
         for (int i = 0; i < nvars; i++) {
-            this.work_tolset[i] = AccurateMath.sqrt(d[i]);
+            this.workTolset[i] = AccurateMath.sqrt(d[i]);
         }
-        tol[0] = eps * this.work_tolset[0];
+        tol[0] = eps * this.workTolset[0];
         for (int col = 1; col < nvars; col++) {
             pos = col - 1;
-            total = work_tolset[col];
+            total = workTolset[col];
             for (int row = 0; row < col; row++) {
-                total += AccurateMath.abs(r[pos]) * work_tolset[row];
+                total += AccurateMath.abs(r[pos]) * workTolset[row];
                 pos += nvars - row - 2;
             }
             tol[col] = eps * total;
         }
-        tol_set = true;
+        tolSet = true;
     }
 
     /**
@@ -381,7 +381,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             throw new ModelSpecificationException(
                     LocalizedFormats.TOO_MANY_REGRESSORS, nreq, this.nvars);
         }
-        if (!this.tol_set) {
+        if (!this.tolSet) {
             tolset();
         }
         final double[] ret = new double[nreq];
@@ -417,7 +417,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
     private void singcheck() {
         int pos;
         for (int i = 0; i < nvars; i++) {
-            work_sing[i] = AccurateMath.sqrt(d[i]);
+            workSing[i] = AccurateMath.sqrt(d[i]);
         }
         for (int col = 0; col < nvars; col++) {
             // Set elements within R to zero if they are less than tol(col) in
@@ -426,7 +426,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             final double temp = tol[col];
             pos = col - 1;
             for (int row = 0; row < col - 1; row++) {
-                if (AccurateMath.abs(r[pos]) * work_sing[row] < temp) {
+                if (AccurateMath.abs(r[pos]) * workSing[row] < temp) {
                     r[pos] = 0.0;
                 }
                 pos += nvars - row - 2;
@@ -435,20 +435,20 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             // element of LINDEP, and use INCLUD to augment the projections in
             // the lower rows of the orthogonalization.
             lindep[col] = false;
-            if (work_sing[col] < temp) {
+            if (workSing[col] < temp) {
                 lindep[col] = true;
                 if (col < nvars - 1) {
-                    Arrays.fill(x_sing, 0.0);
-                    int _pi = col * (nvars + nvars - col - 1) / 2;
-                    for (int _xi = col + 1; _xi < nvars; _xi++, _pi++) {
-                        x_sing[_xi] = r[_pi];
-                        r[_pi] = 0.0;
+                    Arrays.fill(xSing, 0.0);
+                    int pi = col * (nvars + nvars - col - 1) / 2;
+                    for (int xi = col + 1; xi < nvars; xi++, pi++) {
+                        xSing[xi] = r[pi];
+                        r[pi] = 0.0;
                     }
                     final double y = rhs[col];
                     final double weight = d[col];
                     d[col] = 0.0;
                     rhs[col] = 0.0;
-                    this.include(x_sing, weight, y);
+                    this.include(xSing, weight, y);
                 } else {
                     sserr += d[col] * rhs[col] * rhs[col];
                 }
@@ -457,7 +457,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
     }
 
     /**
-     * Calculates the sum of squared errors for the full regression
+     * Calculates the sum of squared errors for the full regression.
      * and all subsets in the following manner: <pre>
      * rss[] ={
      * ResidualSumOfSquares_allNvars,
@@ -472,7 +472,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             total += d[i] * rhs[i] * rhs[i];
             rss[i - 1] = total;
         }
-        rss_set = true;
+        rssSet = true;
     }
 
     /**
@@ -615,8 +615,8 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         int pos;
         int pos1;
         int pos2;
-        final int rms_off = -in;
-        final int wrk_off = -(in + 1);
+        final int rmsOff = -in;
+        final int wrkOff = -(in + 1);
         final double[] rms = new double[nvars - in];
         final double[] work = new double[nvars - in - 1];
         double sumxx;
@@ -627,21 +627,21 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             return null;
         }
         final int nvm = nvars - 1;
-        final int base_pos = r.length - (nvm - in) * (nvm - in + 1) / 2;
+        final int basePos = r.length - (nvm - in) * (nvm - in + 1) / 2;
         if (d[in] > 0.0) {
-            rms[in + rms_off] = 1.0 / AccurateMath.sqrt(d[in]);
+            rms[in + rmsOff] = 1.0 / AccurateMath.sqrt(d[in]);
         }
         for (int col = in + 1; col < nvars; col++) {
-            pos = base_pos + col - 1 - in;
+            pos = basePos + col - 1 - in;
             sumxx = d[col];
             for (int row = in; row < col; row++) {
                 sumxx += d[row] * r[pos] * r[pos];
                 pos += nvars - row - 2;
             }
             if (sumxx > 0.0) {
-                rms[col + rms_off] = 1.0 / AccurateMath.sqrt(sumxx);
+                rms[col + rmsOff] = 1.0 / AccurateMath.sqrt(sumxx);
             } else {
-                rms[col + rms_off] = 0.0;
+                rms[col + rmsOff] = 0.0;
             }
         }
         sumyy = sserr;
@@ -655,11 +655,11 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         for (int col1 = in; col1 < nvars; col1++) {
             sumxy = 0.0;
             Arrays.fill(work, 0.0);
-            pos1 = base_pos + col1 - in - 1;
+            pos1 = basePos + col1 - in - 1;
             for (int row = in; row < col1; row++) {
                 pos2 = pos1 + 1;
                 for (int col2 = col1 + 1; col2 < nvars; col2++) {
-                    work[col2 + wrk_off] += d[row] * r[pos1] * r[pos2];
+                    work[col2 + wrkOff] += d[row] * r[pos1] * r[pos2];
                     pos2++;
                 }
                 sumxy += d[row] * r[pos1] * rhs[row];
@@ -667,14 +667,14 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             }
             pos2 = pos1 + 1;
             for (int col2 = col1 + 1; col2 < nvars; col2++) {
-                work[col2 + wrk_off] += d[col1] * r[pos2];
+                work[col2 + wrkOff] += d[col1] * r[pos2];
                 ++pos2;
                 output[ (col2 - 1 - in) * (col2 - in) / 2 + col1 - in] =
-                        work[col2 + wrk_off] * rms[col1 + rms_off] * rms[col2 + rms_off];
+                        work[col2 + wrkOff] * rms[col1 + rmsOff] * rms[col2 + rmsOff];
                 ++pos;
             }
             sumxy += d[col1] * rhs[col1];
-            output[col1 + rms_off + offXX] = sumxy * rms[col1 + rms_off] * sumyy;
+            output[col1 + rmsOff + offXX] = sumxy * rms[col1 + rmsOff] * sumyy;
         }
 
         return output;
@@ -691,12 +691,12 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
     private void vmove(int from, int to) {
         double d1;
         double d2;
-        double X;
+        double x;
         double d1new;
         double d2new;
         double cbar;
         double sbar;
-        double Y;
+        double y;
         int first;
         int inc;
         int m1;
@@ -707,7 +707,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
         if (from == to) {
             return;
         }
-        if (!this.rss_set) {
+        if (!this.rssSet) {
             ss();
         }
         int count = 0;
@@ -732,62 +732,62 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             d2 = d[mp1];
             // Special cases.
             if (d1 > this.epsilon || d2 > this.epsilon) {
-                X = r[m1];
-                if (AccurateMath.abs(X) * AccurateMath.sqrt(d1) < tol[mp1]) {
-                    X = 0.0;
+                x = r[m1];
+                if (AccurateMath.abs(x) * AccurateMath.sqrt(d1) < tol[mp1]) {
+                    x = 0.0;
                 }
-                if (d1 < this.epsilon || AccurateMath.abs(X) < this.epsilon) {
+                if (d1 < this.epsilon || AccurateMath.abs(x) < this.epsilon) {
                     d[m] = d2;
                     d[mp1] = d1;
                     r[m1] = 0.0;
                     for (int col = m + 2; col < nvars; col++) {
                         ++m1;
-                        X = r[m1];
+                        x = r[m1];
                         r[m1] = r[m2];
-                        r[m2] = X;
+                        r[m2] = x;
                         ++m2;
                     }
-                    X = rhs[m];
+                    x = rhs[m];
                     rhs[m] = rhs[mp1];
-                    rhs[mp1] = X;
+                    rhs[mp1] = x;
                     bSkipTo40 = true;
                     //break;
                 } else if (d2 < this.epsilon) {
-                    d[m] = d1 * X * X;
-                    r[m1] = 1.0 / X;
-                    for (int _i = m1 + 1; _i < m1 + nvars - m - 1; _i++) {
-                        r[_i] /= X;
+                    d[m] = d1 * x * x;
+                    r[m1] = 1.0 / x;
+                    for (int i = m1 + 1; i < m1 + nvars - m - 1; i++) {
+                        r[i] /= x;
                     }
-                    rhs[m] /= X;
+                    rhs[m] /= x;
                     bSkipTo40 = true;
                     //break;
                 }
                 if (!bSkipTo40) {
-                    d1new = d2 + d1 * X * X;
+                    d1new = d2 + d1 * x * x;
                     cbar = d2 / d1new;
-                    sbar = X * d1 / d1new;
+                    sbar = x * d1 / d1new;
                     d2new = d1 * cbar;
                     d[m] = d1new;
                     d[mp1] = d2new;
                     r[m1] = sbar;
                     for (int col = m + 2; col < nvars; col++) {
                         ++m1;
-                        Y = r[m1];
-                        r[m1] = cbar * r[m2] + sbar * Y;
-                        r[m2] = Y - X * r[m2];
+                        y = r[m1];
+                        r[m1] = cbar * r[m2] + sbar * y;
+                        r[m2] = y - x * r[m2];
                         ++m2;
                     }
-                    Y = rhs[m];
-                    rhs[m] = cbar * rhs[mp1] + sbar * Y;
-                    rhs[mp1] = Y - X * rhs[mp1];
+                    y = rhs[m];
+                    rhs[m] = cbar * rhs[mp1] + sbar * y;
+                    rhs[mp1] = y - x * rhs[mp1];
                 }
             }
             if (m > 0) {
                 pos = m;
                 for (int row = 0; row < m; row++) {
-                    X = r[pos];
+                    x = r[pos];
                     r[pos] = r[pos - 1];
-                    r[pos - 1] = X;
+                    r[pos - 1] = x;
                     pos += nvars - row - 2;
                 }
             }
@@ -796,9 +796,9 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             m1 = vorder[m];
             vorder[m] = vorder[mp1];
             vorder[mp1] = m1;
-            X = tol[m];
+            x = tol[m];
             tol[m] = tol[mp1];
-            tol[mp1] = X;
+            tol[mp1] = x;
             rss[m] = rss[mp1] + d[mp1] * rhs[mp1] * rhs[mp1];
 
             m += inc;
@@ -851,24 +851,24 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
     /**
      * Gets the diagonal of the Hat matrix also known as the leverage matrix.
      *
-     * @param  row_data returns the diagonal of the hat matrix for this observation
+     * @param  rowData returns the diagonal of the hat matrix for this observation
      * @return the diagonal element of the hatmatrix
      */
-    public double getDiagonalOfHatMatrix(double[] row_data) {
+    public double getDiagonalOfHatMatrix(double[] rowData) {
         double[] wk = new double[this.nvars];
         int pos;
         double total;
 
-        if (row_data.length > nvars) {
+        if (rowData.length > nvars) {
             return Double.NaN;
         }
         double[] xrow;
         if (this.hasIntercept) {
-            xrow = new double[row_data.length + 1];
+            xrow = new double[rowData.length + 1];
             xrow[0] = 1.0;
-            System.arraycopy(row_data, 0, xrow, 1, row_data.length);
+            System.arraycopy(rowData, 0, xrow, 1, rowData.length);
         } else {
-            xrow = row_data;
+            xrow = rowData;
         }
         double hii = 0.0;
         for (int col = 0; col < xrow.length; col++) {
@@ -975,16 +975,16 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
 
             int idx1 = 0;
             int idx2;
-            int _i;
-            int _j;
+            int ii;
+            int jj;
             for (int i = 0; i < beta.length; i++) {
-                _i = newIndices[i];
+                ii = newIndices[i];
                 for (int j = 0; j <= i; j++, idx1++) {
-                    _j = newIndices[j];
-                    if (_i > _j) {
-                        idx2 = _i * (_i + 1) / 2 + _j;
+                    jj = newIndices[j];
+                    if (ii > jj) {
+                        idx2 = ii * (ii + 1) / 2 + jj;
                     } else {
-                        idx2 = _j * (_j + 1) / 2 + _i;
+                        idx2 = jj * (jj + 1) / 2 + ii;
                     }
                     covNew[idx1] = cov[idx2];
                 }
@@ -1086,16 +1086,16 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio
             double[] covNew = new double[cov.length];
             int idx1 = 0;
             int idx2;
-            int _i;
-            int _j;
+            int ii;
+            int jj;
             for (int i = 0; i < beta.length; i++) {
-                _i = newIndices[i];
+                ii = newIndices[i];
                 for (int j = 0; j <= i; j++, idx1++) {
-                    _j = newIndices[j];
-                    if (_i > _j) {
-                        idx2 = _i * (_i + 1) / 2 + _j;
+                    jj = newIndices[j];
+                    if (ii > jj) {
+                        idx2 = ii * (ii + 1) / 2 + jj;
                     } else {
-                        idx2 = _j * (_j + 1) / 2 + _i;
+                        idx2 = jj * (jj + 1) / 2 + ii;
                     }
                     covNew[idx1] = cov[idx2];
                 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/OLSMultipleLinearRegression.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/OLSMultipleLinearRegression.java
index 341b92f..d8e9ad6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/OLSMultipleLinearRegression.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/OLSMultipleLinearRegression.java
@@ -53,10 +53,10 @@ import org.apache.commons.math4.legacy.stat.descriptive.moment.SecondMoment;
  */
 public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegression {
 
-    /** Cached QR decomposition of X matrix */
+    /** Cached QR decomposition of X matrix. */
     private QRDecomposition qr;
 
-    /** Singularity threshold for QR decomposition */
+    /** Singularity threshold for QR decomposition. */
     private final double threshold;
 
     /**
@@ -125,9 +125,9 @@ public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
      */
     public RealMatrix calculateHat() {
         // Create augmented identity matrix
-        RealMatrix Q = qr.getQ();
+        RealMatrix q = qr.getQ();
         final int p = qr.getR().getColumnDimension();
-        final int n = Q.getColumnDimension();
+        final int n = q.getColumnDimension();
         // No try-catch or advertised NotStrictlyPositiveException - NPE above if n < 3
         Array2DRowRealMatrix augI = new Array2DRowRealMatrix(n, n);
         double[][] augIData = augI.getDataRef();
@@ -143,7 +143,7 @@ public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
 
         // Compute and return Hat matrix
         // No DME advertised - args valid if we get here
-        return Q.multiply(augI).multiply(Q.transpose());
+        return q.multiply(augI).multiply(q.transpose());
     }
 
     /**
@@ -277,9 +277,9 @@ public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegressio
     @Override
     protected RealMatrix calculateBetaVariance() {
         int p = getX().getColumnDimension();
-        RealMatrix Raug = qr.getR().getSubMatrix(0, p - 1 , 0, p - 1);
-        RealMatrix Rinv = new LUDecomposition(Raug).getSolver().getInverse();
-        return Rinv.multiply(Rinv.transpose());
+        RealMatrix rAug = qr.getR().getSubMatrix(0, p - 1 , 0, p - 1);
+        RealMatrix rInv = new LUDecomposition(rAug).getSolver().getInverse();
+        return rInv.multiply(rInv.transpose());
     }
 
 }
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/RegressionResults.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/RegressionResults.java
index f18f4a3..2d7fbd6 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/RegressionResults.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/RegressionResults.java
@@ -29,36 +29,36 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  */
 public class RegressionResults implements Serializable {
 
-    /** INDEX of Sum of Squared Errors */
+    /** INDEX of Sum of Squared Errors. */
     private static final int SSE_IDX = 0;
-    /** INDEX of Sum of Squares of Model */
+    /** INDEX of Sum of Squares of Model. */
     private static final int SST_IDX = 1;
-    /** INDEX of R-Squared of regression */
+    /** INDEX of R-Squared of regression. */
     private static final int RSQ_IDX = 2;
-    /** INDEX of Mean Squared Error */
+    /** INDEX of Mean Squared Error. */
     private static final int MSE_IDX = 3;
-    /** INDEX of Adjusted R Squared */
+    /** INDEX of Adjusted R Squared. */
     private static final int ADJRSQ_IDX = 4;
-    /** UID */
-    private static final long serialVersionUID = 1l;
-    /** regression slope parameters */
+    /** UID. */
+    private static final long serialVersionUID = 1L;
+    /** regression slope parameters. */
     private final double[] parameters;
-    /** variance covariance matrix of parameters */
+    /** variance covariance matrix of parameters. */
     private final double[][] varCovData;
-    /** boolean flag for variance covariance matrix in symm compressed storage */
+    /** boolean flag for variance covariance matrix in symm compressed storage. */
     private final boolean isSymmetricVCD;
-    /** rank of the solution */
+    /** rank of the solution. */
     @SuppressWarnings("unused")
     private final int rank;
-    /** number of observations on which results are based */
+    /** number of observations on which results are based. */
     private final long nobs;
-    /** boolean flag indicator of whether a constant was included*/
+    /** boolean flag indicator of whether a constant was included. */
     private final boolean containsConstant;
-    /** array storing global results, SSE, MSE, RSQ, adjRSQ */
+    /** array storing global results, SSE, MSE, RSQ, adjRSQ. */
     private final double[] globalFitInfo;
 
     /**
-     *  Set the default constructor to private access
+     *  Set the default constructor to private access.
      *  to prevent inadvertent instantiation
      */
     @SuppressWarnings("unused")
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/SimpleRegression.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/SimpleRegression.java
index 5eb2828..849c7be 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/SimpleRegression.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/SimpleRegression.java
@@ -62,39 +62,39 @@ import org.apache.commons.numbers.core.Precision;
  */
 public class SimpleRegression implements Serializable, UpdatingMultipleLinearRegression {
 
-    /** Serializable version identifier */
+    /** Serializable version identifier. */
     private static final long serialVersionUID = -3004689053607543335L;
 
-    /** sum of x values */
+    /** sum of x values. */
     private double sumX;
 
-    /** total variation in x (sum of squared deviations from xbar) */
+    /** total variation in x (sum of squared deviations from xbar). */
     private double sumXX;
 
-    /** sum of y values */
+    /** sum of y values. */
     private double sumY;
 
-    /** total variation in y (sum of squared deviations from ybar) */
+    /** total variation in y (sum of squared deviations from ybar). */
     private double sumYY;
 
-    /** sum of products */
+    /** sum of products. */
     private double sumXY;
 
-    /** number of observations */
+    /** number of observations. */
     private long n;
 
-    /** mean of accumulated x values, used in updating formulas */
+    /** mean of accumulated x values, used in updating formulas. */
     private double xbar;
 
-    /** mean of accumulated y values, used in updating formulas */
+    /** mean of accumulated y values, used in updating formulas. */
     private double ybar;
 
-    /** include an intercept or not */
+    /** include an intercept or not. */
     private final boolean hasIntercept;
     // ---------------------Public methods--------------------------------------
 
     /**
-     * Create an empty SimpleRegression instance
+     * Create an empty SimpleRegression instance.
      */
     public SimpleRegression() {
         this(true);
@@ -783,9 +783,9 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
             if (AccurateMath.abs(sumXX) > Precision.SAFE_MIN) {
                 final double[] params = new double[] { getIntercept(), getSlope() };
                 final double mse = getMeanSquareError();
-                final double _syy = sumYY + sumY * sumY / n;
+                final double syy = sumYY + sumY * sumY / n;
                 final double[] vcv = new double[] { mse * (xbar * xbar / sumXX + 1.0 / n), -xbar * mse / sumXX, mse / sumXX };
-                return new RegressionResults(params, new double[][] { vcv }, true, n, 2, sumY, _syy, getSumSquaredErrors(), true,
+                return new RegressionResults(params, new double[][] { vcv }, true, n, 2, sumY, syy, getSumSquaredErrors(), true,
                         false);
             } else {
                 final double[] params = new double[] { sumY / n, Double.NaN };
@@ -813,7 +813,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
     }
 
     /**
-     * Performs a regression on data present in buffers including only regressors
+     * Performs a regression on data present in buffers including only regressors.
      * indexed in variablesToInclude and outputs a RegressionResults object
      * @param variablesToInclude an array of indices of regressors to include
      * @return RegressionResults acts as a container of regression output
@@ -846,28 +846,28 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg
                 if( variablesToInclude[0] != 1 && variablesToInclude[0] != 0 ){
                      throw new OutOfRangeException( variablesToInclude[0],0,1 );
                 }
-                final double _mean = sumY * sumY / n;
-                final double _syy = sumYY + _mean;
+                final double mean = sumY * sumY / n;
+                final double syy = sumYY + mean;
                 if( variablesToInclude[0] == 0 ){
                     //just the mean
                     final double[] vcv = new double[]{ sumYY/(((n-1)*n)) };
                     final double[] params = new double[]{ ybar };
                     return new RegressionResults(
                       params, new double[][]{vcv}, true, n, 1,
-                      sumY, _syy+_mean, sumYY,true,false);
+                      sumY, syy+mean, sumYY,true,false);
 
                 }else if( variablesToInclude[0] == 1){
                     //final double _syy = sumYY + sumY * sumY / ((double) n);
-                    final double _sxx = sumXX + sumX * sumX / n;
-                    final double _sxy = sumXY + sumX * sumY / n;
-                    final double _sse = AccurateMath.max(0d, _syy - _sxy * _sxy / _sxx);
-                    final double _mse = _sse/((n-1));
-                    if( !Double.isNaN(_sxx) ){
-                        final double[] vcv = new double[]{ _mse / _sxx };
-                        final double[] params = new double[]{ _sxy/_sxx };
+                    final double sxx = sumXX + sumX * sumX / n;
+                    final double sxy = sumXY + sumX * sumY / n;
+                    final double sse = AccurateMath.max(0d, syy - sxy * sxy / sxx);
+                    final double mse = sse/((n-1));
+                    if( !Double.isNaN(sxx) ){
+                        final double[] vcv = new double[]{ mse / sxx };
+                        final double[] params = new double[]{ sxy/sxx };
                         return new RegressionResults(
                                     params, new double[][]{vcv}, true, n, 1,
-                                    sumY, _syy, _sse,false,false);
+                                    sumY, syy, sse,false,false);
                     }else{
                         final double[] vcv = new double[]{Double.NaN };
                         final double[] params = new double[]{ Double.NaN };
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/UpdatingMultipleLinearRegression.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/UpdatingMultipleLinearRegression.java
index 1dbeb9b..9008bc2 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/UpdatingMultipleLinearRegression.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/stat/regression/UpdatingMultipleLinearRegression.java
@@ -73,7 +73,7 @@ public interface UpdatingMultipleLinearRegression {
 
 
     /**
-     * Performs a regression on data present in buffers and outputs a RegressionResults object
+     * Performs a regression on data present in buffers and outputs a RegressionResults object.
      * @return RegressionResults acts as a container of regression output
      * @throws ModelSpecificationException if the model is not correctly specified
      * @throws NoDataException if there is not sufficient data in the model to
@@ -82,7 +82,7 @@ public interface UpdatingMultipleLinearRegression {
     RegressionResults regress() throws ModelSpecificationException, NoDataException;
 
     /**
-     * Performs a regression on data present in buffers including only regressors
+     * Performs a regression on data present in buffers including only regressors.
      * indexed in variablesToInclude and outputs a RegressionResults object
      * @param variablesToInclude an array of indices of regressors to include
      * @return RegressionResults acts as a container of regression output
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CombinatoricsUtils.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CombinatoricsUtils.java
index b747476..efbd41d 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CombinatoricsUtils.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CombinatoricsUtils.java
@@ -76,7 +76,7 @@ public final class CombinatoricsUtils {
             // we must stop computation at row 26
             final int maxIndex = 26;
             stirlingS2 = new long[maxIndex][];
-            stirlingS2[0] = new long[] { 1l };
+            stirlingS2[0] = new long[] { 1L };
             for (int i = 1; i < stirlingS2.length; ++i) {
                 stirlingS2[i] = new long[i + 1];
                 stirlingS2[i][0] = 0;
@@ -102,7 +102,7 @@ public final class CombinatoricsUtils {
             } else if (k == 1 || k == n) {
                 return 1;
             } else if (k == 2) {
-                return (1l << (n - 1)) - 1l;
+                return (1L << (n - 1)) - 1L;
             } else if (k == n - 1) {
                 return BinomialCoefficient.value(n, 2);
             } else {
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CompositeFormat.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CompositeFormat.java
index 6e6f946..65bd1bc 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CompositeFormat.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/util/CompositeFormat.java
@@ -25,7 +25,7 @@ import java.util.Locale;
  * Base class for formatters of composite objects (complex numbers, vectors ...).
  *
  */
-public class CompositeFormat {
+public final class CompositeFormat {
 
     /**
      * Class contains only static methods.
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/PerfTestUtils.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/PerfTestUtils.java
index 0de36ec..14c36d3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/PerfTestUtils.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/PerfTestUtils.java
@@ -33,7 +33,7 @@ import org.apache.commons.math4.legacy.stat.descriptive.SummaryStatistics;
 /**
  * Simple benchmarking utilities.
  */
-public class PerfTestUtils {
+public final class PerfTestUtils {
     /** Formatting. */
     private static final int DEFAULT_MAX_NAME_WIDTH = 45;
     /** Formatting. */
@@ -55,6 +55,9 @@ public class PerfTestUtils {
     /** RNG. */
     private static UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C);
 
+    /** No instances. */
+    private PerfTestUtils() {}
+
     /**
      * Timing.
      *
@@ -281,7 +284,7 @@ public class PerfTestUtils {
     /**
      * Utility class for storing a test label.
      */
-    public static abstract class RunTest implements Callable<Double> {
+    public abstract static class RunTest implements Callable<Double> {
         private final String name;
 
         /**
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/Retry.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/Retry.java
index 51c3b30..7d82d1e 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/Retry.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/Retry.java
@@ -17,7 +17,10 @@
 
 package org.apache.commons.math4.legacy;
 
-import java.lang.annotation.*;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 /**
  * Annotation that enables test retries.
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/RetryRunnerTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/RetryRunnerTest.java
index 559c710..51718e4 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/RetryRunnerTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/RetryRunnerTest.java
@@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
  */
 @RunWith(RetryRunner.class)
 public class RetryRunnerTest {
-    final Random rng = new Random();
+    private final Random rng = new Random();
 
     /**
      * Shows that an always failing test will fail even if it is retried.
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
index 5a498c8..5939cc5 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
@@ -38,7 +38,7 @@ import org.apache.commons.math4.legacy.stat.inference.ChiSquareTest;
 
 /**
  */
-public class TestUtils {
+public final class TestUtils {
     /**
      * Collection of static methods used in math unit tests.
      */
@@ -452,7 +452,7 @@ public class TestUtils {
         double sumsq = 0d;
         for (int i = 0; i < values.length; i++) {
             final double dev = values[i] - target;
-            sumsq += (dev * dev);
+            sumsq += dev * dev;
         }
         return sumsq;
     }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/FunctionUtilsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/FunctionUtilsTest.java
index 17b749c..f39e7b3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/FunctionUtilsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/FunctionUtilsTest.java
@@ -37,7 +37,6 @@ import org.apache.commons.math4.legacy.analysis.function.Power;
 import org.apache.commons.math4.legacy.analysis.function.Sin;
 import org.apache.commons.math4.legacy.analysis.function.Sinc;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
-import org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException;
 import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 import org.junit.Assert;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructureTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructureTest.java
index 454d3c9..23cf796 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructureTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/DerivativeStructureTest.java
@@ -1251,7 +1251,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
         Assert.assertEquals(-2.0, x.rint().getPartialDerivative(0), 1.0e-15);
         Assert.assertEquals(+0.0, x.rint().getPartialDerivative(1), 1.0e-15);
         Assert.assertEquals(-2.0, x.subtract(x.getField().getOne()).rint().getPartialDerivative(0), 1.0e-15);
-        Assert.assertEquals(-1l, x.round());
+        Assert.assertEquals(-1L, x.round());
 
     }
 
@@ -1481,7 +1481,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
     public void testLinearCombination2DSDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11L);
 
         for (int i = 0; i < 10000; ++i) {
             final DerivativeStructure[] u = new DerivativeStructure[4];
@@ -1525,7 +1525,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
     public void testLinearCombination2DoubleDS() {
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
-        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11l);
+        UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A, 0xc6af886975069f11L);
 
         for (int i = 0; i < 10000; ++i) {
             final double[] u = new double[4];
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/JacobianFunctionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/JacobianFunctionTest.java
index ed98c4c..39b9ff5 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/JacobianFunctionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/JacobianFunctionTest.java
@@ -50,7 +50,7 @@ public class JacobianFunctionTest {
 
         private final double radius;
 
-        public SphereMapping(final double radius) {
+        SphereMapping(final double radius) {
             this.radius = radius;
         }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradientTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradientTest.java
index aadb601..5fda691 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradientTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/differentiation/SparseGradientTest.java
@@ -875,7 +875,7 @@ public class SparseGradientTest extends ExtendedFieldElementAbstractTest<SparseG
         Assert.assertEquals(-2.0, x.rint().getValue(), 1.0e-15);
         Assert.assertEquals(+0.0, x.rint().getDerivative(0), 1.0e-15);
         Assert.assertEquals(-2.0, x.subtract(x.getField().getOne()).rint().getValue(), 1.0e-15);
-        Assert.assertEquals(-1l, x.round(), 1.0e-15);
+        Assert.assertEquals(-1L, x.round(), 1.0e-15);
 
     }
 
@@ -1024,7 +1024,7 @@ public class SparseGradientTest extends ExtendedFieldElementAbstractTest<SparseG
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
         UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A,
-                                                           0xc6af886975069f11l);
+                                                           0xc6af886975069f11L);
 
         for (int i = 0; i < 10000; ++i) {
             final SparseGradient[] u = new SparseGradient[4];
@@ -1069,7 +1069,7 @@ public class SparseGradientTest extends ExtendedFieldElementAbstractTest<SparseG
         // we compare accurate versus naive dot product implementations
         // on regular vectors (i.e. not extreme cases like in the previous test)
         UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A,
-                                                           0xc6af886975069f11l);
+                                                           0xc6af886975069f11L);
 
         for (int i = 0; i < 10000; ++i) {
             final double[] u = new double[4];
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/function/LogitTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/function/LogitTest.java
index fbaa481..a3c3a05 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/function/LogitTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/function/LogitTest.java
@@ -159,7 +159,7 @@ public class LogitTest {
         final Logit f = new Logit(lo, hi);
         final Sigmoid g = new Sigmoid(lo, hi);
         final UniformRandomProvider random = RandomSource.create(RandomSource.WELL_1024_A,
-                                                                 0x49914cdd9f0b8db5l);
+                                                                 0x49914cdd9f0b8db5L);
         final UnivariateDifferentiableFunction id = FunctionUtils.compose((UnivariateDifferentiableFunction) g,
                                                                 (UnivariateDifferentiableFunction) f);
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/IterativeLegendreGaussIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/IterativeLegendreGaussIntegratorTest.java
index f00e8f5..61e210c 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/IterativeLegendreGaussIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/IterativeLegendreGaussIntegratorTest.java
@@ -36,7 +36,11 @@ public class IterativeLegendreGaussIntegratorTest {
         UnivariateFunction f = new Sin();
         BaseAbstractUnivariateIntegrator integrator
             = new IterativeLegendreGaussIntegrator(5, 1.0e-14, 1.0e-10, 2, 15);
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = AccurateMath.PI; expected = 2;
         tolerance = AccurateMath.max(integrator.getAbsoluteAccuracy(),
@@ -60,7 +64,10 @@ public class IterativeLegendreGaussIntegratorTest {
                                                      BaseAbstractUnivariateIntegrator.DEFAULT_ABSOLUTE_ACCURACY,
                                                      BaseAbstractUnivariateIntegrator.DEFAULT_MIN_ITERATIONS_COUNT,
                                                      64);
-        double min, max, expected, result;
+        double min;
+        double max;
+        double expected;
+        double result;
 
         min = 0; max = 1; expected = -1.0/48;
         result = integrator.integrate(10000, f, min, max);
@@ -77,7 +84,7 @@ public class IterativeLegendreGaussIntegratorTest {
 
     @Test
     public void testExactIntegration() {
-        Random random = new Random(86343623467878363l);
+        Random random = new Random(86343623467878363L);
         for (int n = 2; n < 6; ++n) {
             IterativeLegendreGaussIntegrator integrator =
                 new IterativeLegendreGaussIntegrator(n,
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegratorTest.java
index 2ac0361..892b9ff 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/RombergIntegratorTest.java
@@ -43,7 +43,11 @@ public final class RombergIntegratorTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateIntegrator integrator = new RombergIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = AccurateMath.PI; expected = 2;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
@@ -67,7 +71,11 @@ public final class RombergIntegratorTest {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateIntegrator integrator = new RombergIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = 1; expected = -1.0/48;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
index 01434e5..66a82b5 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegratorTest.java
@@ -21,7 +21,6 @@ import org.apache.commons.math4.legacy.analysis.UnivariateFunction;
 import org.apache.commons.math4.legacy.analysis.function.Identity;
 import org.apache.commons.math4.legacy.analysis.function.Inverse;
 import org.apache.commons.math4.legacy.analysis.function.Sin;
-import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialsUtils;
 import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException;
 import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
@@ -46,7 +45,11 @@ public final class SimpsonIntegratorTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateIntegrator integrator = new SimpsonIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = AccurateMath.PI; expected = 2;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
@@ -70,7 +73,11 @@ public final class SimpsonIntegratorTest {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateIntegrator integrator = new SimpsonIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = 1; expected = -1.0/48;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
@@ -159,7 +166,11 @@ public final class SimpsonIntegratorTest {
         UnivariateFunction f = new Identity();
         UnivariateIntegrator integrator = new SimpsonIntegrator(1, SIMPSON_MAX_ITERATIONS_COUNT);
 
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = 1; expected = 0.5;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
@@ -184,8 +195,7 @@ public final class SimpsonIntegratorTest {
      *       Composite_Simpson's_rule</a>
      */
     private static double compositeSimpsonsRule(UnivariateFunction f, double a,
-            double b, int n)
-    {
+            double b, int n) {
         // Sum interval [a,b] split into n subintervals, with n an even number:
         // sum ~ h/3 * [ f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) ... + 4f(xn-1) + f(xn) ]
         // h = (b-a)/n
@@ -197,10 +207,11 @@ public final class SimpsonIntegratorTest {
         for (int i = 1; i < n; i++) {
             // Alternate sums that are multiplied by 4 and 2
             final double fxi = f.value(a + i * h);
-            if (i % 2 == 0)
+            if (i % 2 == 0) {
                 sum2 += fxi;
-            else
+            } else {
                 sum4 += fxi;
+            }
         }
         return (h / 3) * (f.value(a) + 4 * sum4 + 2 * sum2 + f.value(b));
     }
@@ -215,8 +226,7 @@ public final class SimpsonIntegratorTest {
      * @return the integral between a and b
      */
     private static double computeSimpsonIteration(UnivariateFunction f, double a,
-            double b, int iteration)
-    {
+            double b, int iteration) {
         // The first possible Simpson's sum uses n=2.
         // The next uses n=4. This is the 1st refinement expected when the
         // integrator has performed 1 iteration.
@@ -231,7 +241,12 @@ public final class SimpsonIntegratorTest {
     public void testReferenceSimpsonItegrationIsCorrect() {
         UnivariateFunction f = new Sin();
 
-        double a, b, h, expected, result, tolerance;
+        double a;
+        double b;
+        double h;
+        double expected;
+        double result;
+        double tolerance;
 
         a = 0.5;
         b = 1;
@@ -283,7 +298,11 @@ public final class SimpsonIntegratorTest {
         UnivariateIntegrator integrator = new SimpsonIntegrator(
                 0, Double.POSITIVE_INFINITY,
                 1, SIMPSON_MAX_ITERATIONS_COUNT);
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         // MATH-1458: minimalIterationCount==1 computes incorrect
         // Simpson sum (following no iteration)
@@ -311,8 +330,13 @@ public final class SimpsonIntegratorTest {
         // series. The convergence can then be controlled.
         UnivariateFunction f = new Inverse();
 
-        double min, max, expected, result, tolerance;
-        int minIteration, maxIteration;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
+        int minIteration;
+        int maxIteration;
 
         // Range for integration
         min = 1;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegratorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegratorTest.java
index 0ea6a46..e39a6a3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegratorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegratorTest.java
@@ -42,7 +42,11 @@ public final class TrapezoidIntegratorTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateIntegrator integrator = new TrapezoidIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = AccurateMath.PI; expected = 2;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
@@ -66,7 +70,11 @@ public final class TrapezoidIntegratorTest {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateIntegrator integrator = new TrapezoidIntegrator();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 0; max = 1; expected = -1.0/48;
         tolerance = AccurateMath.abs(expected * integrator.getRelativeAccuracy());
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/gauss/GaussianQuadratureAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/gauss/GaussianQuadratureAbstractTest.java
index f1ead32..3711c6e 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/gauss/GaussianQuadratureAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/integration/gauss/GaussianQuadratureAbstractTest.java
@@ -79,7 +79,7 @@ public abstract class GaussianQuadratureAbstractTest {
      * @param n Degree of the monomial.
      * @return the expected value of the integral of x<sup>n</sup>.
      */
-    public abstract double getExpectedValue(final int n);
+    public abstract double getExpectedValue(int n);
 
     /**
      * Checks that the value of the integral of each monomial
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/AkimaSplineInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/AkimaSplineInterpolatorTest.java
index 9826397..eb1621d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/AkimaSplineInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/AkimaSplineInterpolatorTest.java
@@ -33,71 +33,53 @@ import org.apache.commons.numbers.core.Precision;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class AkimaSplineInterpolatorTest
-{
-
+public class AkimaSplineInterpolatorTest {
     @Test
-    public void testIllegalArguments()
-    {
+    public void testIllegalArguments() {
         // Data set arrays of different size.
         UnivariateInterpolator i = new AkimaSplineInterpolator();
 
-        try
-        {
-            double yval[] = { 0.0, 1.0, 2.0, 3.0, 4.0 };
-            i.interpolate( null, yval );
-            Assert.fail( "Failed to detect x null pointer" );
-        }
-        catch ( NullArgumentException iae )
-        {
+        try {
+            double yval[] = {0.0, 1.0, 2.0, 3.0, 4.0};
+            i.interpolate(null, yval);
+            Assert.fail("Failed to detect x null pointer");
+        } catch (NullArgumentException iae) {
             // Expected.
         }
 
-        try
-        {
-            double xval[] = { 0.0, 1.0, 2.0, 3.0, 4.0 };
-            i.interpolate( xval, null );
-            Assert.fail( "Failed to detect y null pointer" );
-        }
-        catch ( NullArgumentException iae )
-        {
+        try {
+            double xval[] = {0.0, 1.0, 2.0, 3.0, 4.0};
+            i.interpolate(xval, null);
+            Assert.fail("Failed to detect y null pointer");
+        } catch (NullArgumentException iae) {
             // Expected.
         }
 
-        try
-        {
-            double xval[] = { 0.0, 1.0, 2.0, 3.0 };
-            double yval[] = { 0.0, 1.0, 2.0, 3.0 };
-            i.interpolate( xval, yval );
-            Assert.fail( "Failed to detect insufficient data" );
-        }
-        catch ( NumberIsTooSmallException iae )
-        {
+        try {
+            double xval[] = {0.0, 1.0, 2.0, 3.0};
+            double yval[] = {0.0, 1.0, 2.0, 3.0};
+            i.interpolate(xval, yval);
+            Assert.fail("Failed to detect insufficient data");
+        } catch (NumberIsTooSmallException iae) {
             // Expected.
         }
 
-        try
-        {
-            double xval[] = { 0.0, 1.0, 2.0, 3.0, 4.0 };
-            double yval[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
-            i.interpolate( xval, yval );
-            Assert.fail( "Failed to detect data set array with different sizes." );
-        }
-        catch ( DimensionMismatchException iae )
-        {
+        try {
+            double xval[] = {0.0, 1.0, 2.0, 3.0, 4.0};
+            double yval[] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
+            i.interpolate(xval, yval);
+            Assert.fail("Failed to detect data set array with different sizes.");
+        } catch (DimensionMismatchException iae) {
             // Expected.
         }
 
         // X values not sorted.
-        try
-        {
-            double xval[] = { 0.0, 1.0, 0.5, 7.0, 3.5, 2.2, 8.0 };
-            double yval[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
-            i.interpolate( xval, yval );
-            Assert.fail( "Failed to detect unsorted arguments." );
-        }
-        catch ( NonMonotonicSequenceException iae )
-        {
+        try {
+            double xval[] = {0.0, 1.0, 0.5, 7.0, 3.5, 2.2, 8.0};
+            double yval[] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
+            i.interpolate(xval, yval);
+            Assert.fail("Failed to detect unsorted arguments.");
+        } catch (NonMonotonicSequenceException iae) {
             // Expected.
         }
     }
@@ -108,8 +90,7 @@ public class AkimaSplineInterpolatorTest
      * of elements
      */
     @Test
-    public void testInterpolateLine()
-    {
+    public void testInterpolateLine() {
         final int numberOfElements = 10;
         final double minimumX = -10;
         final double maximumX = 10;
@@ -117,11 +98,9 @@ public class AkimaSplineInterpolatorTest
         final double interpolationTolerance = 1e-15;
         final double maxTolerance = 1e-15;
 
-        UnivariateFunction f = new UnivariateFunction()
-        {
+        UnivariateFunction f = new UnivariateFunction() {
             @Override
-            public double value( double x )
-            {
+            public double value(double x) {
                 return 2 * x - 5;
             }
         };
@@ -137,8 +116,7 @@ public class AkimaSplineInterpolatorTest
      */
 
     @Test
-    public void testInterpolateParabola()
-    {
+    public void testInterpolateParabola() {
         final int numberOfElements = 10;
         final double minimumX = -10;
         final double maximumX = 10;
@@ -146,12 +124,10 @@ public class AkimaSplineInterpolatorTest
         final double interpolationTolerance = 7e-15;
         final double maxTolerance = 6e-14;
 
-        UnivariateFunction f = new UnivariateFunction()
-        {
+        UnivariateFunction f = new UnivariateFunction() {
             @Override
-            public double value( double x )
-            {
-                return ( 3 * x * x ) - ( 5 * x ) + 7;
+            public double value(double x) {
+                return (3 * x * x) - (5 * x) + 7;
             }
         };
 
@@ -165,8 +141,7 @@ public class AkimaSplineInterpolatorTest
      * the same span with the same number of elements
      */
     @Test
-    public void testInterpolateCubic()
-    {
+    public void testInterpolateCubic() {
         final int numberOfElements = 10;
         final double minimumX = -3;
         final double maximumX = 3;
@@ -174,12 +149,10 @@ public class AkimaSplineInterpolatorTest
         final double interpolationTolerance = 0.37;
         final double maxTolerance = 3.8;
 
-        UnivariateFunction f = new UnivariateFunction()
-        {
+        UnivariateFunction f = new UnivariateFunction() {
             @Override
-            public double value( double x )
-            {
-                return ( 3 * x * x * x ) - ( 0.5 * x * x ) + ( 1 * x ) - 1;
+            public double value(double x) {
+                return (3 * x * x * x) - (0.5 * x * x) + (1 * x) - 1;
             }
         };
 
@@ -223,8 +196,7 @@ public class AkimaSplineInterpolatorTest
     }
 
     private void testInterpolation( double minimumX, double maximumX, int numberOfElements, int numberOfSamples,
-                                    UnivariateFunction f, double tolerance, double maxTolerance )
-    {
+                                    UnivariateFunction f, double tolerance, double maxTolerance ) {
         double expected;
         double actual;
         double currentX;
@@ -232,18 +204,16 @@ public class AkimaSplineInterpolatorTest
         double xValues[] = new double[numberOfElements];
         double yValues[] = new double[numberOfElements];
 
-        for ( int i = 0; i < numberOfElements; i++ )
-        {
+        for (int i = 0; i < numberOfElements; i++) {
             xValues[i] = minimumX + delta * (double) i;
-            yValues[i] = f.value( xValues[i] );
+            yValues[i] = f.value(xValues[i]);
         }
 
         UnivariateFunction interpolation = new AkimaSplineInterpolator().interpolate( xValues, yValues );
 
-        for ( int i = 0; i < numberOfElements; i++ )
-        {
+        for (int i = 0; i < numberOfElements; i++) {
             currentX = xValues[i];
-            expected = f.value( currentX );
+            expected = f.value(currentX);
             actual = interpolation.value( currentX );
             assertTrue( Precision.equals( expected, actual ) );
         }
@@ -253,15 +223,14 @@ public class AkimaSplineInterpolatorTest
             new UniformContinuousDistribution(xValues[0], xValues[xValues.length - 1]).createSampler(rng);
 
         double sumError = 0;
-        for ( int i = 0; i < numberOfSamples; i++ )
-        {
+        for (int i = 0; i < numberOfSamples; i++) {
             currentX = distX.sample();
-            expected = f.value( currentX );
+            expected = f.value(currentX);
             actual = interpolation.value( currentX );
             sumError += AccurateMath.abs( actual - expected );
             assertEquals( expected, actual, maxTolerance );
         }
 
-        assertEquals( 0.0, ( sumError / (double) numberOfSamples ), tolerance );
+        assertEquals( 0.0, sumError / (double) numberOfSamples, tolerance );
     }
 }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunctionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunctionTest.java
index 6dbad6e..8ad44fe 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunctionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatingFunctionTest.java
@@ -131,10 +131,8 @@ public final class BicubicInterpolatingFunctionTest {
             = new BicubicInterpolatingFunction(xval, yval, f,
                                                      dFdX, dFdY, dFdXdY);
 
-        double x, y;
-
-        x = xMin;
-        y = yMin;
+        double x = xMin;
+        double y = yMin;
         Assert.assertTrue(bcf.isValidPoint(x, y));
         // Ensure that no exception is thrown.
         bcf.value(x, y);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatorTest.java
index 29478a8..db061c3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/BicubicInterpolatorTest.java
@@ -145,7 +145,6 @@ public final class BicubicInterpolatorTest {
 
         final BicubicInterpolator interpolator = new BicubicInterpolator();
         final BicubicInterpolatingFunction p = interpolator.interpolate(xval, yval, zval);
-        double x, y;
 
         final UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C);
         final ContinuousDistribution.Sampler distX = new UniformContinuousDistribution(xval[0], xval[xval.length - 1]).createSampler(rng);
@@ -153,8 +152,8 @@ public final class BicubicInterpolatorTest {
 
         int count = 0;
         while (true) {
-            x = distX.sample();
-            y = distY.sample();
+            double x = distX.sample();
+            double y = distY.sample();
             if (!p.isValidPoint(x, y)) {
                 if (print) {
                     System.out.println("# " + x + " " + y);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolatorTest.java
index 149dec0..f9ebdb0 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/DividedDifferenceInterpolatorTest.java
@@ -49,11 +49,17 @@ public final class DividedDifferenceInterpolatorTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateInterpolator interpolator = new DividedDifferenceInterpolator();
-        double x[], y[], z, expected, result, tolerance;
+        double[] x;
+        double[] y;
+        double z;
+        double expected;
+        double result;
+        double tolerance;
 
         // 6 interpolating points on interval [0, 2*PI]
         int n = 6;
-        double min = 0.0, max = 2 * AccurateMath.PI;
+        double min = 0.0;
+        double max = 2 * AccurateMath.PI;
         x = new double[n];
         y = new double[n];
         for (int i = 0; i < n; i++) {
@@ -81,11 +87,17 @@ public final class DividedDifferenceInterpolatorTest {
     public void testExpm1Function() {
         UnivariateFunction f = new Expm1();
         UnivariateInterpolator interpolator = new DividedDifferenceInterpolator();
-        double x[], y[], z, expected, result, tolerance;
+        double[] x;
+        double[] y;
+        double z;
+        double expected;
+        double result;
+        double tolerance;
 
         // 5 interpolating points on interval [-1, 1]
         int n = 5;
-        double min = -1.0, max = 1.0;
+        double min = -1.0;
+        double max = 1.0;
         x = new double[n];
         y = new double[n];
         for (int i = 0; i < n; i++) {
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/FieldHermiteInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/FieldHermiteInterpolatorTest.java
index 63c6378..d591208 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/FieldHermiteInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/FieldHermiteInterpolatorTest.java
@@ -92,7 +92,7 @@ public class FieldHermiteInterpolatorTest {
     @Test
     public void testRandomPolynomialsValuesOnly() {
 
-        Random random = new Random(0x42b1e7dbd361a932l);
+        Random random = new Random(0x42b1e7dbd361a932L);
 
         for (int i = 0; i < 100; ++i) {
 
@@ -134,7 +134,7 @@ public class FieldHermiteInterpolatorTest {
     @Test
     public void testRandomPolynomialsFirstDerivative() {
 
-        Random random = new Random(0x570803c982ca5d3bl);
+        Random random = new Random(0x570803c982ca5d3bL);
 
         for (int i = 0; i < 100; ++i) {
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/HermiteInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/HermiteInterpolatorTest.java
index d3cb140..4712206 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/HermiteInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/HermiteInterpolatorTest.java
@@ -77,7 +77,7 @@ public class HermiteInterpolatorTest {
     @Test
     public void testRandomPolynomialsValuesOnly() {
 
-        Random random = new Random(0x42b1e7dbd361a932l);
+        Random random = new Random(0x42b1e7dbd361a932L);
 
         for (int i = 0; i < 100; ++i) {
 
@@ -118,7 +118,7 @@ public class HermiteInterpolatorTest {
     @Test
     public void testRandomPolynomialsFirstDerivative() {
 
-        Random random = new Random(0x570803c982ca5d3bl);
+        Random random = new Random(0x570803c982ca5d3bL);
 
         for (int i = 0; i < 100; ++i) {
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/LinearInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/LinearInterpolatorTest.java
index d8abb7c..34813be 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/LinearInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/LinearInterpolatorTest.java
@@ -41,9 +41,8 @@ public class LinearInterpolatorTest {
     protected double interpolationTolerance = 1E-12;
 
     @Test
-    public void testInterpolateLinearDegenerateTwoSegment()
-        {
-        double x[] = { 0.0, 0.5, 1.0 };
+    public void testInterpolateLinearDegenerateTwoSegment() {
+        double x[] = {0.0, 0.5, 1.0};
         double y[] = { 0.0, 0.5, 1.0 };
         UnivariateInterpolator i = new LinearInterpolator();
         UnivariateFunction f = i.interpolate(x, y);
@@ -63,9 +62,8 @@ public class LinearInterpolatorTest {
     }
 
     @Test
-    public void testInterpolateLinearDegenerateThreeSegment()
-        {
-        double x[] = { 0.0, 0.5, 1.0, 1.5 };
+    public void testInterpolateLinearDegenerateThreeSegment() {
+        double x[] = {0.0, 0.5, 1.0, 1.5};
         double y[] = { 0.0, 0.5, 1.0, 1.5 };
         UnivariateInterpolator i = new LinearInterpolator();
         UnivariateFunction f = i.interpolate(x, y);
@@ -137,11 +135,9 @@ public class LinearInterpolatorTest {
     /**
      * verifies that f(x[i]) = y[i] for i = 0..n-1 where n is common length.
      */
-    protected void verifyInterpolation(UnivariateFunction f, double x[], double y[])
-       {
+    protected void verifyInterpolation(UnivariateFunction f, double x[], double y[]) {
         for (int i = 0; i < x.length; i++) {
             Assert.assertEquals(f.value(x[i]), y[i], knotTolerance);
         }
     }
-
 }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolatorTest.java
index c99e9f3..74e1b94 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/MicrosphereProjectionInterpolatorTest.java
@@ -94,7 +94,9 @@ public final class MicrosphereProjectionInterpolatorTest {
         final MultivariateFunction p2D = interpolator2D.interpolate(x, y);
 
         double[] c = new double[dim];
-        double expected, result, result2D;
+        double expected;
+        double result;
+        double result2D;
 
         final int sampleIndex = 2;
         c[0] = x[sampleIndex][0];
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolatorTest.java
index 8b9bce1..7c37d86 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/NevilleInterpolatorTest.java
@@ -49,11 +49,17 @@ public final class NevilleInterpolatorTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateInterpolator interpolator = new NevilleInterpolator();
-        double x[], y[], z, expected, result, tolerance;
+        double[] x;
+        double[] y;
+        double z;
+        double expected;
+        double result;
+        double tolerance;
 
         // 6 interpolating points on interval [0, 2*PI]
         int n = 6;
-        double min = 0.0, max = 2 * AccurateMath.PI;
+        double min = 0.0;
+        double max = 2 * AccurateMath.PI;
         x = new double[n];
         y = new double[n];
         for (int i = 0; i < n; i++) {
@@ -81,11 +87,17 @@ public final class NevilleInterpolatorTest {
     public void testExpm1Function() {
         UnivariateFunction f = new Expm1();
         UnivariateInterpolator interpolator = new NevilleInterpolator();
-        double x[], y[], z, expected, result, tolerance;
+        double[] x;
+        double[] y;
+        double z;
+        double expected;
+        double result;
+        double tolerance;
 
         // 5 interpolating points on interval [-1, 1]
         int n = 5;
-        double min = -1.0, max = 1.0;
+        double min = -1.0;
+        double max = 1.0;
         x = new double[n];
         y = new double[n];
         for (int i = 0; i < n; i++) {
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
index 1c3ec32..cb8d51a 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/PiecewiseBicubicSplineInterpolatorTest.java
@@ -156,7 +156,8 @@ public final class PiecewiseBicubicSplineInterpolatorTest {
 
         BivariateGridInterpolator interpolator = new PiecewiseBicubicSplineInterpolator();
         BivariateFunction p = interpolator.interpolate(xval, yval, zval);
-        double x, y;
+        double x;
+        double y;
 
         final UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C, 1234567L);
         final ContinuousDistribution.Sampler distX = new UniformContinuousDistribution(xval[0], xval[xval.length - 1]).createSampler(rng);
@@ -208,7 +209,8 @@ public final class PiecewiseBicubicSplineInterpolatorTest {
 
         BivariateGridInterpolator interpolator = new PiecewiseBicubicSplineInterpolator();
         BivariateFunction p = interpolator.interpolate(xval, yval, zval);
-        double x, y;
+        double x;
+        double y;
 
         final UniformRandomProvider rng = RandomSource.create(RandomSource.WELL_19937_C, 1234567L);
         final ContinuousDistribution.Sampler distX = new UniformContinuousDistribution(xval[0], xval[xval.length - 1]).createSampler(rng);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/SplineInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/SplineInterpolatorTest.java
index 7d48afe..005497d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/SplineInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/SplineInterpolatorTest.java
@@ -43,8 +43,7 @@ public class SplineInterpolatorTest {
     protected double interpolationTolerance = 1E-14;
 
     @Test
-    public void testInterpolateLinearDegenerateTwoSegment()
-        {
+    public void testInterpolateLinearDegenerateTwoSegment() {
         double tolerance = 1e-15;
         double x[] = { 0.0, 0.5, 1.0 };
         double y[] = { 0.0, 0.5, 1.0 };
@@ -67,8 +66,7 @@ public class SplineInterpolatorTest {
     }
 
     @Test
-    public void testInterpolateLinearDegenerateThreeSegment()
-        {
+    public void testInterpolateLinearDegenerateThreeSegment() {
         double tolerance = 1e-15;
         double x[] = { 0.0, 0.5, 1.0, 1.5 };
         double y[] = { 0.0, 0.5, 1.0, 1.5 };
@@ -196,8 +194,7 @@ public class SplineInterpolatorTest {
     /**
      * verifies that f(x[i]) = y[i] for i = 0..n-1 where n is common length.
      */
-    protected void verifyInterpolation(UnivariateFunction f, double x[], double y[])
-       {
+    protected void verifyInterpolation(UnivariateFunction f, double x[], double y[]) {
         for (int i = 0; i < x.length; i++) {
             Assert.assertEquals(f.value(x[i]), y[i], knotTolerance);
         }
@@ -207,8 +204,7 @@ public class SplineInterpolatorTest {
      * Verifies that interpolating polynomials satisfy consistency requirement:
      *    adjacent polynomials must agree through two derivatives at knot points
      */
-    protected void verifyConsistency(PolynomialSplineFunction f, double x[])
-        {
+    protected void verifyConsistency(PolynomialSplineFunction f, double x[]) {
         PolynomialFunction polynomials[] = f.getPolynomials();
         for (int i = 1; i < x.length - 2; i++) {
             // evaluate polynomials and derivatives at x[i + 1]
@@ -219,5 +215,4 @@ public class SplineInterpolatorTest {
                                 polynomials[i + 1].polynomialDerivative().polynomialDerivative().value(0), 0.5);
         }
     }
-
 }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatorTest.java
index a735d34..00932e8 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatorTest.java
@@ -145,8 +145,11 @@ public final class TricubicInterpolatorTest {
                                                                         yval,
                                                                         zval,
                                                                         fval);
-        double x, y, z;
-        double expected, result;
+        double x;
+        double y;
+        double z;
+        double expected;
+        double result;
 
         x = 4;
         y = -3;
@@ -205,8 +208,11 @@ public final class TricubicInterpolatorTest {
                                                                         zval,
                                                                         fval);
 
-        double x, y, z;
-        double expected, result;
+        double x;
+        double y;
+        double z;
+        double expected;
+        double result;
 
         x = 4;
         y = -3;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeFormTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeFormTest.java
index cae0cd2..bb2b924 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeFormTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionLagrangeFormTest.java
@@ -36,7 +36,11 @@ public final class PolynomialFunctionLagrangeFormTest {
     @Test
     public void testLinearFunction() {
         PolynomialFunctionLagrangeForm p;
-        double c[], z, expected, result, tolerance = 1E-12;
+        double[] c;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = 1.5x - 4
         double x[] = { 0.0, 3.0 };
@@ -66,7 +70,11 @@ public final class PolynomialFunctionLagrangeFormTest {
     @Test
     public void testQuadraticFunction() {
         PolynomialFunctionLagrangeForm p;
-        double c[], z, expected, result, tolerance = 1E-12;
+        double[] c;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = 2x^2 + 5x - 3 = (2x - 1)(x + 3)
         double x[] = { 0.0, -1.0, 0.5 };
@@ -97,7 +105,11 @@ public final class PolynomialFunctionLagrangeFormTest {
     @Test
     public void testQuinticFunction() {
         PolynomialFunctionLagrangeForm p;
-        double c[], z, expected, result, tolerance = 1E-12;
+        double[] c;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = x^5 - x^4 - 7x^3 + x^2 + 6x = x(x^2 - 1)(x + 2)(x - 3)
         double x[] = { 1.0, -1.0, 2.0, 3.0, -3.0, 0.5 };
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionNewtonFormTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionNewtonFormTest.java
index 1d3466b..2ea0a05 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionNewtonFormTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialFunctionNewtonFormTest.java
@@ -36,7 +36,11 @@ public final class PolynomialFunctionNewtonFormTest {
     @Test
     public void testLinearFunction() {
         PolynomialFunctionNewtonForm p;
-        double coefficients[], z, expected, result, tolerance = 1E-12;
+        double[] coefficients;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = 1.5x - 4 = 2 + 1.5(x-4)
         double a[] = { 2.0, 1.5 };
@@ -66,7 +70,11 @@ public final class PolynomialFunctionNewtonFormTest {
     @Test
     public void testQuadraticFunction() {
         PolynomialFunctionNewtonForm p;
-        double coefficients[], z, expected, result, tolerance = 1E-12;
+        double[] coefficients;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = 2x^2 + 5x - 3 = 4 + 3(x-1) + 2(x-1)(x+2)
         double a[] = { 4.0, 3.0, 2.0 };
@@ -97,7 +105,11 @@ public final class PolynomialFunctionNewtonFormTest {
     @Test
     public void testQuinticFunction() {
         PolynomialFunctionNewtonForm p;
-        double coefficients[], z, expected, result, tolerance = 1E-12;
+        double[] coefficients;
+        double z;
+        double expected;
+        double result;
+        double tolerance = 1E-12;
 
         // p(x) = x^5 - x^4 - 7x^3 + x^2 + 6x
         //      = 6x - 6x^2 -6x^2(x-1) + x^2(x-1)(x+1) + x^2(x-1)(x+1)(x-2)
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtilsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtilsTest.java
index 62fe6f8..5a4a498 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtilsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/polynomials/PolynomialsUtilsTest.java
@@ -146,20 +146,20 @@ public class PolynomialsUtilsTest {
 
     @Test
     public void testFirstLaguerrePolynomials() {
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(3), 6l, "6 - 18 x + 9 x^2 - x^3");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(2), 2l, "2 - 4 x + x^2");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(1), 1l, "1 - x");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(0), 1l, "1");
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(3), 6L, "6 - 18 x + 9 x^2 - x^3");
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(2), 2L, "2 - 4 x + x^2");
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(1), 1L, "1 - x");
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(0), 1L, "1");
 
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(7), 5040l,
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(7), 5040L,
                 "5040 - 35280 x + 52920 x^2 - 29400 x^3"
                 + " + 7350 x^4 - 882 x^5 + 49 x^6 - x^7");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(6),  720l,
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(6),  720L,
                 "720 - 4320 x + 5400 x^2 - 2400 x^3 + 450 x^4"
                 + " - 36 x^5 + x^6");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(5),  120l,
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(5),  120L,
         "120 - 600 x + 600 x^2 - 200 x^3 + 25 x^4 - x^5");
-        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(4),   24l,
+        checkPolynomial(PolynomialsUtils.createLaguerrePolynomial(4),   24L,
         "24 - 96 x + 72 x^2 - 16 x^3 + x^4");
 
     }
@@ -204,15 +204,15 @@ public class PolynomialsUtilsTest {
 
     @Test
     public void testFirstLegendrePolynomials() {
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(3),  2l, "-3 x + 5 x^3");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(2),  2l, "-1 + 3 x^2");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(1),  1l, "x");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(0),  1l, "1");
-
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(7), 16l, "-35 x + 315 x^3 - 693 x^5 + 429 x^7");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(6), 16l, "-5 + 105 x^2 - 315 x^4 + 231 x^6");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(5),  8l, "15 x - 70 x^3 + 63 x^5");
-        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(4),  8l, "3 - 30 x^2 + 35 x^4");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(3),  2L, "-3 x + 5 x^3");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(2),  2L, "-1 + 3 x^2");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(1),  1L, "x");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(0),  1L, "1");
+
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(7), 16L, "-35 x + 315 x^3 - 693 x^5 + 429 x^7");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(6), 16L, "-5 + 105 x^2 - 315 x^4 + 231 x^6");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(5),  8L, "15 x - 70 x^3 + 63 x^5");
+        checkPolynomial(PolynomialsUtils.createLegendrePolynomial(4),  8L, "3 - 30 x^2 + 35 x^4");
 
     }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolverTest.java
index c9730ee..8538982 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolverTest.java
@@ -177,7 +177,7 @@ public final class BracketingNthOrderBrentSolverTest extends BaseSecantSolverAbs
 
     }
 
-    private static abstract class TestFunction implements UnivariateDifferentiableFunction {
+    private abstract static class TestFunction implements UnivariateDifferentiableFunction {
 
         private final double root;
         private final double min;
@@ -207,8 +207,6 @@ public final class BracketingNthOrderBrentSolverTest extends BaseSecantSolverAbs
         }
 
         @Override
-        public abstract DerivativeStructure value(final DerivativeStructure t);
-
+        public abstract DerivativeStructure value(DerivativeStructure t);
     }
-
 }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
index a0d2f9b..45b607e 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/FieldBracketingNthOrderBrentSolverTest.java
@@ -138,20 +138,19 @@ public final class FieldBracketingNthOrderBrentSolverTest {
         Dfp xResult = solver.solve(maxEval, f, field.newDfp(min), field.newDfp(max),
                                    allowedSolution);
         Dfp yResult = f.value(xResult);
+        boolean increasing;
         switch (allowedSolution) {
         case ANY_SIDE :
             Assert.assertTrue(yResult.abs().lessThan(functionValueAccuracy.multiply(2)));
             break;
-        case LEFT_SIDE : {
-            boolean increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
+        case LEFT_SIDE :
+            increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
             Assert.assertTrue(increasing ? yResult.negativeOrNull() : yResult.positiveOrNull());
             break;
-        }
-        case RIGHT_SIDE : {
-            boolean increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
+        case RIGHT_SIDE :
+            increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
             Assert.assertTrue(increasing ? yResult.positiveOrNull() : yResult.negativeOrNull());
             break;
-        }
         case BELOW_SIDE :
             Assert.assertTrue(yResult.negativeOrNull());
             break;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolverTest.java
index 83b6c95..23ee62d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolverTest.java
@@ -40,7 +40,11 @@ public final class LaguerreSolverTest {
      */
     @Test
     public void testLinearFunction() {
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         // p(x) = 4x - 1
         double coefficients[] = { -1.0, 4.0 };
@@ -59,7 +63,11 @@ public final class LaguerreSolverTest {
      */
     @Test
     public void testQuadraticFunction() {
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         // p(x) = 2x^2 + 5x - 3 = (x+3)(2x-1)
         double coefficients[] = { -3.0, 5.0, 2.0 };
@@ -84,7 +92,11 @@ public final class LaguerreSolverTest {
      */
     @Test
     public void testQuinticFunction() {
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         // p(x) = x^5 - x^4 - 12x^3 + x^2 - x - 12 = (x+1)(x+3)(x-4)(x^2-x+1)
         double coefficients[] = { -12.0, -1.0, 1.0, -12.0, -1.0, 1.0 };
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolver2Test.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolver2Test.java
index aca22e7..9ba53c0 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolver2Test.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolver2Test.java
@@ -46,7 +46,11 @@ public final class MullerSolver2Test {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateSolver solver = new MullerSolver2();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 3.0; max = 4.0; expected = AccurateMath.PI;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -68,7 +72,11 @@ public final class MullerSolver2Test {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateSolver solver = new MullerSolver2();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = -0.4; max = 0.2; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -98,7 +106,11 @@ public final class MullerSolver2Test {
     public void testExpm1Function() {
         UnivariateFunction f = new Expm1();
         UnivariateSolver solver = new MullerSolver2();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = -1.0; max = 2.0; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolverTest.java
index 2f8740d..ba2dcb0 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/MullerSolverTest.java
@@ -46,7 +46,11 @@ public final class MullerSolverTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateSolver solver = new MullerSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 3.0; max = 4.0; expected = AccurateMath.PI;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -68,7 +72,11 @@ public final class MullerSolverTest {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateSolver solver = new MullerSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = -0.4; max = 0.2; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -100,7 +108,11 @@ public final class MullerSolverTest {
     public void testExpm1Function() {
         UnivariateFunction f = new Expm1();
         UnivariateSolver solver = new MullerSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max; 
+        double expected;
+        double result;
+        double tolerance;
 
         min = -1.0; max = 2.0; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/RiddersSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/RiddersSolverTest.java
index 3edee2e..e7bf519 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/RiddersSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/analysis/solvers/RiddersSolverTest.java
@@ -44,7 +44,11 @@ public final class RiddersSolverTest {
     public void testSinFunction() {
         UnivariateFunction f = new Sin();
         UnivariateSolver solver = new RiddersSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = 3.0; max = 4.0; expected = AccurateMath.PI;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -66,7 +70,11 @@ public final class RiddersSolverTest {
     public void testQuinticFunction() {
         UnivariateFunction f = new QuinticFunction();
         UnivariateSolver solver = new RiddersSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = -0.4; max = 0.2; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
@@ -94,7 +102,11 @@ public final class RiddersSolverTest {
     public void testExpm1Function() {
         UnivariateFunction f = new Expm1();
         UnivariateSolver solver = new RiddersSolver();
-        double min, max, expected, result, tolerance;
+        double min;
+        double max;
+        double expected;
+        double result;
+        double tolerance;
 
         min = -1.0; max = 2.0; expected = 0.0;
         tolerance = AccurateMath.max(solver.getAbsoluteAccuracy(),
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/AbstractIntegerDistributionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/AbstractIntegerDistributionTest.java
index d7761af..844bcea 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/AbstractIntegerDistributionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/AbstractIntegerDistributionTest.java
@@ -28,8 +28,7 @@ public class AbstractIntegerDistributionTest {
     protected final double p = diceDistribution.probability(1);
 
     @Test
-    public void testInverseCumulativeProbabilityMethod()
-    {
+    public void testInverseCumulativeProbabilityMethod() {
         double precision = 0.000000000000001;
         Assert.assertEquals(1, diceDistribution.inverseCumulativeProbability(0));
         Assert.assertEquals(1, diceDistribution.inverseCumulativeProbability((1d-Double.MIN_VALUE)/6d));
@@ -43,7 +42,7 @@ public class AbstractIntegerDistributionTest {
         Assert.assertEquals(5, diceDistribution.inverseCumulativeProbability((5d-precision)/6d));//Can't use Double.MIN
         Assert.assertEquals(6, diceDistribution.inverseCumulativeProbability((5d+precision)/6d));
         Assert.assertEquals(6, diceDistribution.inverseCumulativeProbability((6d-precision)/6d));//Can't use Double.MIN
-        Assert.assertEquals(6, diceDistribution.inverseCumulativeProbability((6d)/6d));
+        Assert.assertEquals(6, diceDistribution.inverseCumulativeProbability(6d/6d));
     }
 
     @Test
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistributionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistributionTest.java
index 5ebccc9..70b9f1d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistributionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EmpiricalDistributionTest.java
@@ -703,7 +703,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
      */
     private class ConstantKernelEmpiricalDistribution extends EmpiricalDistribution {
         private static final long serialVersionUID = 1L;
-        public ConstantKernelEmpiricalDistribution(int i) {
+        ConstantKernelEmpiricalDistribution(int i) {
             super(i);
         }
         // Use constant distribution equal to bin mean within bin
@@ -718,7 +718,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
      */
     private class UniformKernelEmpiricalDistribution extends EmpiricalDistribution {
         private static final long serialVersionUID = 2963149194515159653L;
-        public UniformKernelEmpiricalDistribution(int i) {
+        UniformKernelEmpiricalDistribution(int i) {
             super(i);
         }
         @Override
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EnumeratedIntegerDistributionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EnumeratedIntegerDistributionTest.java
index eed3443..c9fe76b 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EnumeratedIntegerDistributionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/distribution/EnumeratedIntegerDistributionTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.math4.legacy.distribution;
 
-import java.util.Arrays;
 import org.apache.commons.statistics.distribution.DiscreteDistribution;
 import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
 import org.apache.commons.math4.legacy.exception.MathArithmeticException;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java
index 5c111ed..17cb291 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/field/ExtendedFieldElementAbstractTest.java
@@ -393,7 +393,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFaFa() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xfafal);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xfafaL);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 10);
             double[] bD = generateDouble(r, 10);
@@ -406,7 +406,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDaFa() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdafal);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdafaL);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 10);
             double[] bD = generateDouble(r, 10);
@@ -418,7 +418,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF2() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff2l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff2L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 2);
             double[] bD = generateDouble(r, 2);
@@ -433,7 +433,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF2() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf2l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf2L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 2);
             double[] bD = generateDouble(r, 2);
@@ -447,7 +447,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF3() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff3l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff3L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 3);
             double[] bD = generateDouble(r, 3);
@@ -463,7 +463,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF3() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf3l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf3L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 3);
             double[] bD = generateDouble(r, 3);
@@ -478,7 +478,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationFF4() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff4l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xff4L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 4);
             double[] bD = generateDouble(r, 4);
@@ -495,7 +495,7 @@ public abstract class ExtendedFieldElementAbstractTest<T extends RealFieldElemen
 
     @Test
     public void testLinearCombinationDF4() {
-        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf4l);
+        UniformRandomProvider r = RandomSource.create(RandomSource.WELL_1024_A, 0xdf4L);
         for (int i = 0; i < 50; ++i) {
             double[] aD = generateDouble(r, 4);
             double[] bD = generateDouble(r, 4);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitterTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitterTest.java
index da359a2..a6544dc 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitterTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/PolynomialCurveFitterTest.java
@@ -57,7 +57,7 @@ public class PolynomialCurveFitterTest {
 
     @Test
     public void testNoError() {
-        final Random randomizer = new Random(64925784252l);
+        final Random randomizer = new Random(64925784252L);
         for (int degree = 1; degree < 10; ++degree) {
             final PolynomialFunction p = buildRandomPolynomial(degree, randomizer);
             final SimpleCurveFitter fitter = PolynomialCurveFitter.create(degree);
@@ -79,7 +79,7 @@ public class PolynomialCurveFitterTest {
 
     @Test
     public void testSmallError() {
-        final Random randomizer = new Random(53882150042l);
+        final Random randomizer = new Random(53882150042L);
         double maxError = 0;
         for (int degree = 0; degree < 10; ++degree) {
             final PolynomialFunction p = buildRandomPolynomial(degree, randomizer);
@@ -110,7 +110,7 @@ public class PolynomialCurveFitterTest {
 
     @Test
     public void testLargeSample() {
-        final Random randomizer = new Random(0x5551480dca5b369bl);
+        final Random randomizer = new Random(0x5551480dca5b369bL);
         double maxError = 0;
         for (int degree = 0; degree < 10; ++degree) {
             final PolynomialFunction p = buildRandomPolynomial(degree, randomizer);
@@ -134,7 +134,7 @@ public class PolynomialCurveFitterTest {
     }
 
     private void checkUnsolvableProblem(boolean solvable) {
-        final Random randomizer = new Random(1248788532l);
+        final Random randomizer = new Random(1248788532L);
 
         for (int degree = 0; degree < 10; ++degree) {
             final PolynomialFunction p = buildRandomPolynomial(degree, randomizer);
@@ -150,9 +150,9 @@ public class PolynomialCurveFitterTest {
 
             try {
                 fitter.fit(obs.toList());
-                Assert.assertTrue(solvable || (degree == 0));
+                Assert.assertTrue(solvable || degree == 0);
             } catch(ConvergenceException e) {
-                Assert.assertTrue((! solvable) && (degree > 0));
+                Assert.assertTrue(!solvable && degree > 0);
             }
         }
     }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java
index d7f2768..6f1c35c 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java
@@ -118,7 +118,7 @@ public abstract class AbstractLeastSquaresOptimizerAbstractTest {
     /**
      * The subject under test.
      */
-    public final LeastSquaresOptimizer optimizer = this.getOptimizer();
+    protected final LeastSquaresOptimizer optimizer = this.getOptimizer();
 
     @Test
     public void testGetIterations() {
@@ -567,7 +567,7 @@ public abstract class AbstractLeastSquaresOptimizerAbstractTest {
         private final RealMatrix factors;
         private final double[] target;
 
-        public LinearProblem(double[][] factors, double[] target) {
+        LinearProblem(double[][] factors, double[] target) {
             this.factors = new BlockRealMatrix(factors);
             this.target = target;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/BevingtonProblem.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/BevingtonProblem.java
index 202a664..b23936f 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/BevingtonProblem.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/BevingtonProblem.java
@@ -27,7 +27,7 @@ class BevingtonProblem {
     private List<Double> time;
     private List<Double> count;
 
-    public BevingtonProblem() {
+    BevingtonProblem() {
         time = new ArrayList<>();
         count = new ArrayList<>();
     }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleProblem.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleProblem.java
index 8970f15..9664c7a 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleProblem.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleProblem.java
@@ -53,9 +53,9 @@ class CircleProblem {
      * @param searchResolution Number of points to try when searching the one
      * that is closest to a given "observed" point.
      */
-    public CircleProblem(double xError,
-                         double yError,
-                         int searchResolution) {
+    CircleProblem(double xError,
+                  double yError,
+                  int searchResolution) {
         points = new ArrayList<>();
         xSigma = xError;
         ySigma = yError;
@@ -66,8 +66,8 @@ class CircleProblem {
      * @param xError Assumed error for the x-coordinate of the circle points.
      * @param yError Assumed error for the y-coordinate of the circle points.
      */
-    public CircleProblem(double xError,
-                         double yError) {
+    CircleProblem(double xError,
+                  double yError) {
         this(xError, yError, 500);
     }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleVectorial.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleVectorial.java
index 14a557b..219ee30 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleVectorial.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/CircleVectorial.java
@@ -28,7 +28,7 @@ import org.apache.commons.math4.legacy.analysis.MultivariateVectorFunction;
 class CircleVectorial {
     private ArrayList<Vector2D> points;
 
-    public CircleVectorial() {
+    CircleVectorial() {
         points  = new ArrayList<>();
     }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunctionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunctionTest.java
index d309d45..18b1e61 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunctionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/DifferentiatorVectorMultivariateJacobianFunctionTest.java
@@ -45,8 +45,7 @@ public class DifferentiatorVectorMultivariateJacobianFunctionTest {
         if(automatic) {
             return base()
                     .model(new DifferentiatorVectorMultivariateJacobianFunction(problem.getModelFunction(), differentiator));
-        }
-        else {
+        } else {
             return base()
                     .model(problem.getModelFunction(), problem.getModelFunctionJacobian());
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/MinpackTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/MinpackTest.java
index 7d748aa..58191a7 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/MinpackTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/MinpackTest.java
@@ -524,7 +524,7 @@ public class MinpackTest {
         }
     }
 
-    private static abstract class MinpackFunction {
+    private abstract static class MinpackFunction {
         protected int      n;
         protected int      m;
         protected double[] startParams;
@@ -614,9 +614,9 @@ public class MinpackTest {
 
     private static class LinearFullRankFunction extends MinpackFunction {
 
-        public LinearFullRankFunction(int m, int n, double x0,
-                                      double theoreticalStartCost,
-                                      double theoreticalMinCost) {
+        LinearFullRankFunction(int m, int n, double x0,
+                               double theoreticalStartCost,
+                               double theoreticalMinCost) {
             super(m, buildArray(n, x0), theoreticalMinCost,
                   buildArray(n, -1.0));
         }
@@ -652,9 +652,9 @@ public class MinpackTest {
 
     private static class LinearRank1Function extends MinpackFunction {
 
-        public LinearRank1Function(int m, int n, double x0,
-                                   double theoreticalStartCost,
-                                   double theoreticalMinCost) {
+        LinearRank1Function(int m, int n, double x0,
+                            double theoreticalStartCost,
+                            double theoreticalMinCost) {
             super(m, buildArray(n, x0), theoreticalMinCost, null);
         }
 
@@ -686,7 +686,7 @@ public class MinpackTest {
 
     private static class LinearRank1ZeroColsAndRowsFunction extends MinpackFunction {
 
-        public LinearRank1ZeroColsAndRowsFunction(int m, int n, double x0) {
+        LinearRank1ZeroColsAndRowsFunction(int m, int n, double x0) {
             super(m, buildArray(n, x0),
                   AccurateMath.sqrt((m * (m + 3) - 6) / (2.0 * (2 * m - 3))),
                   null);
@@ -728,7 +728,7 @@ public class MinpackTest {
     }
 
     private static class RosenbrockFunction extends MinpackFunction {
-        public RosenbrockFunction(double[] startParams, double theoreticalStartCost) {
+        RosenbrockFunction(double[] startParams, double theoreticalStartCost) {
             super(2, startParams, 0.0, buildArray(2, 1.0));
         }
 
@@ -747,8 +747,8 @@ public class MinpackTest {
     }
 
     private static class HelicalValleyFunction extends MinpackFunction {
-        public HelicalValleyFunction(double[] startParams,
-                                     double theoreticalStartCost) {
+        HelicalValleyFunction(double[] startParams,
+                              double theoreticalStartCost) {
             super(3, startParams, 0.0, new double[] { 1.0, 0.0, 0.0 });
         }
 
@@ -793,8 +793,8 @@ public class MinpackTest {
 
     private static class PowellSingularFunction extends MinpackFunction {
 
-        public PowellSingularFunction(double[] startParams,
-                                      double theoreticalStartCost) {
+        PowellSingularFunction(double[] startParams,
+                               double theoreticalStartCost) {
             super(4, startParams, 0.0, buildArray(4, 0.0));
         }
 
@@ -832,10 +832,10 @@ public class MinpackTest {
 
     private static class FreudensteinRothFunction extends MinpackFunction {
 
-        public FreudensteinRothFunction(double[] startParams,
-                                        double theoreticalStartCost,
-                                        double theoreticalMinCost,
-                                        double[] theoreticalMinParams) {
+        FreudensteinRothFunction(double[] startParams,
+                                 double theoreticalStartCost,
+                                 double theoreticalMinCost,
+                                 double[] theoreticalMinParams) {
             super(2, startParams, theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -862,10 +862,10 @@ public class MinpackTest {
 
     private static class BardFunction extends MinpackFunction {
 
-        public BardFunction(double x0,
-                            double theoreticalStartCost,
-                            double theoreticalMinCost,
-                            double[] theoreticalMinParams) {
+        BardFunction(double x0,
+                     double theoreticalStartCost,
+                     double theoreticalMinCost,
+                     double[] theoreticalMinParams) {
             super(15, buildArray(3, x0), theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -910,10 +910,10 @@ public class MinpackTest {
 
     private static class KowalikOsborneFunction extends MinpackFunction {
 
-        public KowalikOsborneFunction(double[] startParams,
-                                      double theoreticalStartCost,
-                                      double theoreticalMinCost,
-                                      double[] theoreticalMinParams) {
+        KowalikOsborneFunction(double[] startParams,
+                               double theoreticalStartCost,
+                               double theoreticalMinCost,
+                               double[] theoreticalMinParams) {
             super(11, startParams, theoreticalMinCost,
                   theoreticalMinParams);
             if (theoreticalStartCost > 20.0) {
@@ -965,10 +965,10 @@ public class MinpackTest {
 
     private static class MeyerFunction extends MinpackFunction {
 
-        public MeyerFunction(double[] startParams,
-                             double theoreticalStartCost,
-                             double theoreticalMinCost,
-                             double[] theoreticalMinParams) {
+        MeyerFunction(double[] startParams,
+                      double theoreticalStartCost,
+                      double theoreticalMinCost,
+                      double[] theoreticalMinParams) {
             super(16, startParams, theoreticalMinCost,
                   theoreticalMinParams);
             if (theoreticalStartCost > 1.0e6) {
@@ -1015,10 +1015,10 @@ public class MinpackTest {
 
     private static class WatsonFunction extends MinpackFunction {
 
-        public WatsonFunction(int n, double x0,
-                              double theoreticalStartCost,
-                              double theoreticalMinCost,
-                              double[] theoreticalMinParams) {
+        WatsonFunction(int n, double x0,
+                       double theoreticalStartCost,
+                       double theoreticalMinCost,
+                       double[] theoreticalMinParams) {
             super(31, buildArray(n, x0), theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -1085,8 +1085,8 @@ public class MinpackTest {
 
     private static class Box3DimensionalFunction extends MinpackFunction {
 
-        public Box3DimensionalFunction(int m, double[] startParams,
-                                       double theoreticalStartCost) {
+        Box3DimensionalFunction(int m, double[] startParams,
+                                double theoreticalStartCost) {
             super(m, startParams, 0.0,
                   new double[] { 1.0, 10.0, 1.0 });
         }
@@ -1124,10 +1124,10 @@ public class MinpackTest {
 
     private static class JennrichSampsonFunction extends MinpackFunction {
 
-        public JennrichSampsonFunction(int m, double[] startParams,
-                                       double theoreticalStartCost,
-                                       double theoreticalMinCost,
-                                       double[] theoreticalMinParams) {
+        JennrichSampsonFunction(int m, double[] startParams,
+                                double theoreticalStartCost,
+                                double theoreticalMinCost,
+                                double[] theoreticalMinParams) {
             super(m, startParams, theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -1159,10 +1159,10 @@ public class MinpackTest {
 
     private static class BrownDennisFunction extends MinpackFunction {
 
-        public BrownDennisFunction(int m, double[] startParams,
-                                   double theoreticalStartCost,
-                                   double theoreticalMinCost,
-                                   double[] theoreticalMinParams) {
+        BrownDennisFunction(int m, double[] startParams,
+                            double theoreticalStartCost,
+                            double theoreticalMinCost,
+                            double[] theoreticalMinParams) {
             super(m, startParams, theoreticalMinCost,
                 theoreticalMinParams);
             setCostAccuracy(2.5e-8);
@@ -1215,10 +1215,10 @@ public class MinpackTest {
             return array;
         }
 
-        public ChebyquadFunction(int n, int m, double factor,
-                                 double theoreticalStartCost,
-                                 double theoreticalMinCost,
-                                 double[] theoreticalMinParams) {
+        ChebyquadFunction(int n, int m, double factor,
+                          double theoreticalStartCost,
+                          double theoreticalMinCost,
+                          double[] theoreticalMinParams) {
             super(m, buildChebyquadArray(n, factor), theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -1283,10 +1283,10 @@ public class MinpackTest {
 
     private static class BrownAlmostLinearFunction extends MinpackFunction {
 
-        public BrownAlmostLinearFunction(int m, double factor,
-                                         double theoreticalStartCost,
-                                         double theoreticalMinCost,
-                                         double[] theoreticalMinParams) {
+        BrownAlmostLinearFunction(int m, double factor,
+                                  double theoreticalStartCost,
+                                  double theoreticalMinCost,
+                                  double[] theoreticalMinParams) {
             super(m, buildArray(m, factor), theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -1343,10 +1343,10 @@ public class MinpackTest {
 
     private static class Osborne1Function extends MinpackFunction {
 
-        public Osborne1Function(double[] startParams,
-                                double theoreticalStartCost,
-                                double theoreticalMinCost,
-                                double[] theoreticalMinParams) {
+        Osborne1Function(double[] startParams,
+                         double theoreticalStartCost,
+                         double theoreticalMinCost,
+                         double[] theoreticalMinParams) {
             super(33, startParams, theoreticalMinCost,
                   theoreticalMinParams);
         }
@@ -1395,10 +1395,10 @@ public class MinpackTest {
 
     private static class Osborne2Function extends MinpackFunction {
 
-        public Osborne2Function(double[] startParams,
-                                double theoreticalStartCost,
-                                double theoreticalMinCost,
-                                double[] theoreticalMinParams) {
+        Osborne2Function(double[] startParams,
+                         double theoreticalStartCost,
+                         double theoreticalMinCost,
+                         double[] theoreticalMinParams) {
             super(65, startParams, theoreticalMinCost,
                   theoreticalMinParams);
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/RandomCirclePointGenerator.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/RandomCirclePointGenerator.java
index 7414935..92c6bb7 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/RandomCirclePointGenerator.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/RandomCirclePointGenerator.java
@@ -43,7 +43,6 @@ public class RandomCirclePointGenerator {
      * @param radius Radius of the circle.
      * @param xSigma Error on the x-coordinate of the circumference points.
      * @param ySigma Error on the y-coordinate of the circumference points.
-     * @param seed RNG seed.
      */
     public RandomCirclePointGenerator(double x,
                                       double y,
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDataset.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDataset.java
index 9b62644..59679bd 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDataset.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDataset.java
@@ -318,7 +318,7 @@ public abstract class StatisticalReferenceDataset {
      * @param a the parameters
      * @return the value of the model
      */
-    public abstract double getModelValue(final double x, final double[] a);
+    public abstract double getModelValue(double x, double[] a);
 
     /**
      * Returns the values of the partial derivatives of the model with respect
@@ -328,8 +328,8 @@ public abstract class StatisticalReferenceDataset {
      * @param a the parameters
      * @return the partial derivatives
      */
-    public abstract double[] getModelDerivatives(final double x,
-                                                 final double[] a);
+    public abstract double[] getModelDerivatives(double x,
+                                                 double[] a);
 
     /**
      * <p>
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDatasetFactory.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDatasetFactory.java
index 9388b8c..0826106 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDatasetFactory.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StatisticalReferenceDatasetFactory.java
@@ -27,7 +27,7 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
  * A factory to create instances of {@link StatisticalReferenceDataset} from
  * available resources.
  */
-public class StatisticalReferenceDatasetFactory {
+public final class StatisticalReferenceDatasetFactory {
 
     private StatisticalReferenceDatasetFactory() {
         // Do nothing
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StraightLineProblem.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StraightLineProblem.java
index 50a69b6..94ab169 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StraightLineProblem.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/leastsquares/StraightLineProblem.java
@@ -45,7 +45,7 @@ class StraightLineProblem {
     /**
      * @param error Assumed error for the y-coordinate.
      */
-    public StraightLineProblem(double error) {
+    StraightLineProblem(double error) {
         points = new ArrayList<>();
         sigma = error;
     }
@@ -152,11 +152,11 @@ class StraightLineProblem {
      * Linear function.
      */
     public static class Model implements UnivariateFunction {
-        final double a;
-        final double b;
+        private final double a;
+        private final double b;
 
-        public Model(double a,
-                     double b) {
+        Model(double a,
+              double b) {
             this.a = a;
             this.b = b;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ChromosomeTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ChromosomeTest.java
index 53079e1..77695c3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ChromosomeTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ChromosomeTest.java
@@ -55,7 +55,7 @@ public class ChromosomeTest {
     private abstract static class DummyChromosome extends Chromosome {
         private final int repr;
 
-        public DummyChromosome(final int repr) {
+        DummyChromosome(final int repr) {
             this.repr = repr;
         }
         @Override
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulationTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulationTest.java
index 248e83b..0f5ca05 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulationTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/ElitisticListPopulationTest.java
@@ -92,7 +92,7 @@ public class ElitisticListPopulationTest {
     private static class DummyChromosome extends Chromosome {
         private final int fitness;
 
-        public DummyChromosome() {
+        DummyChromosome() {
             this.fitness = counter;
             counter++;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/FitnessCachingTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/FitnessCachingTest.java
index c96b2cc..13dd488 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/FitnessCachingTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/FitnessCachingTest.java
@@ -82,7 +82,7 @@ public class FitnessCachingTest {
 
     private static class DummyCountingBinaryChromosome extends DummyBinaryChromosome {
 
-        public DummyCountingBinaryChromosome(List<Integer> representation) {
+        DummyCountingBinaryChromosome(List<Integer> representation) {
             super(representation);
         }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestBinary.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestBinary.java
index 96a898b..a91057c 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestBinary.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestBinary.java
@@ -97,7 +97,7 @@ public class GeneticAlgorithmTestBinary {
      */
     private static class FindOnes extends BinaryChromosome {
 
-        public FindOnes(List<Integer> representation) {
+        FindOnes(List<Integer> representation) {
             super(representation);
         }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestPermutations.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestPermutations.java
index 2c10b91..ac3a1c7 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestPermutations.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/GeneticAlgorithmTestPermutations.java
@@ -105,7 +105,7 @@ public class GeneticAlgorithmTestPermutations {
      */
     private static class MinPermutations extends RandomKey<Integer> {
 
-        public MinPermutations(List<Double> representation) {
+        MinPermutations(List<Double> representation) {
             super(representation);
         }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/TournamentSelectionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/TournamentSelectionTest.java
index f392b6c..585a8c3 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/TournamentSelectionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/genetics/TournamentSelectionTest.java
@@ -43,7 +43,7 @@ public class TournamentSelectionTest {
     private static class DummyChromosome extends Chromosome {
         private final int fitness;
 
-        public DummyChromosome() {
+        DummyChromosome() {
             this.fitness = counter;
             counter++;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java
index 0ae912b..bdf0e45 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealFieldTest.java
@@ -18,8 +18,6 @@ package org.apache.commons.math4.legacy.linear;
 
 
 import org.apache.commons.math4.legacy.TestUtils;
-import org.apache.commons.math4.legacy.linear.BigReal;
-import org.apache.commons.math4.legacy.linear.BigRealField;
 import org.junit.Assert;
 import org.junit.Test;
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java
index 4fdf844..148deab 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BigRealTest.java
@@ -22,7 +22,6 @@ import java.math.MathContext;
 
 import org.apache.commons.math4.legacy.TestUtils;
 import org.apache.commons.math4.legacy.exception.MathArithmeticException;
-import org.apache.commons.math4.legacy.linear.BigReal;
 import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
 import org.junit.Assert;
 import org.junit.Test;
@@ -65,8 +64,8 @@ public class BigRealTest {
         Assert.assertEquals(-5.0, new BigReal(-5).doubleValue(), 1.0e-15);
         Assert.assertEquals(-5.0, new BigReal(-5, MathContext.DECIMAL64)
             .doubleValue(), 1.0e-15);
-        Assert.assertEquals(-5.0, new BigReal(-5l).doubleValue(), 1.0e-15);
-        Assert.assertEquals(-5.0, new BigReal(-5l, MathContext.DECIMAL64)
+        Assert.assertEquals(-5.0, new BigReal(-5L).doubleValue(), 1.0e-15);
+        Assert.assertEquals(-5.0, new BigReal(-5L, MathContext.DECIMAL64)
             .doubleValue(), 1.0e-15);
         Assert.assertEquals(1.625, new BigReal("1.625").doubleValue(), 1.0e-15);
         Assert.assertEquals(1.625, new BigReal("1.625", MathContext.DECIMAL64)
@@ -174,7 +173,7 @@ public class BigRealTest {
         Assert.assertTrue(zero.equals(zero2));
         Assert.assertEquals(zero.hashCode(), zero2.hashCode());
         BigReal one = new BigReal(1.0);
-        Assert.assertFalse((one.equals(zero) || zero.equals(one)));
+        Assert.assertFalse(one.equals(zero) || zero.equals(one));
         Assert.assertTrue(one.equals(BigReal.ONE));
     }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java
index c51f179..719aeba 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java
@@ -170,7 +170,7 @@ public final class BlockFieldMatrixTest {
     /** test copy functions */
     @Test
     public void testCopyFunctions() {
-        Random r = new Random(66636328996002l);
+        Random r = new Random(66636328996002L);
         BlockFieldMatrix<Dfp> m1 = createRandomMatrix(r, 47, 83);
         BlockFieldMatrix<Dfp> m2 = new BlockFieldMatrix<>(m1.getData());
         Assert.assertEquals(m1, m2);
@@ -393,7 +393,7 @@ public final class BlockFieldMatrixTest {
         int p = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int q = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int r =  BlockFieldMatrix.BLOCK_SIZE / 2;
-        Random random = new Random(111007463902334l);
+        Random random = new Random(111007463902334L);
         FieldMatrix<Dfp> m1 = createRandomMatrix(random, p, q);
         FieldMatrix<Dfp> m2 = createRandomMatrix(random, q, r);
         FieldMatrix<Dfp> m1m2 = m1.multiply(m2);
@@ -407,7 +407,7 @@ public final class BlockFieldMatrixTest {
         int p = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int q = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int r =  BlockFieldMatrix.BLOCK_SIZE / 2;
-        Random random = new Random(111007463902334l);
+        Random random = new Random(111007463902334L);
         FieldMatrix<Dfp> m1 = createRandomMatrix(random, p, q);
         FieldMatrix<Dfp> m2 = createRandomMatrix(random, q, r);
         FieldMatrix<Dfp> m1m2 = m1.multiply(m2);
@@ -1345,7 +1345,7 @@ public final class BlockFieldMatrixTest {
     }
 
     private static class SetVisitor extends DefaultFieldMatrixChangingVisitor<Dfp> {
-        public SetVisitor() {
+        SetVisitor() {
             super(Dfp25.ZERO);
         }
         @Override
@@ -1356,7 +1356,7 @@ public final class BlockFieldMatrixTest {
 
     private static class GetVisitor extends DefaultFieldMatrixPreservingVisitor<Dfp> {
         private int count;
-        public GetVisitor() {
+        GetVisitor() {
             super(Dfp25.ZERO);
             count = 0;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockRealMatrixTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockRealMatrixTest.java
index 40a1d99..a8f9f1d 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockRealMatrixTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockRealMatrixTest.java
@@ -112,7 +112,7 @@ public final class BlockRealMatrixTest {
     /** test copy functions */
     @Test
     public void testCopyFunctions() {
-        Random r = new Random(66636328996002l);
+        Random r = new Random(66636328996002L);
         BlockRealMatrix m1 = createRandomMatrix(r, 47, 83);
         BlockRealMatrix m2 = new BlockRealMatrix(m1.getData());
         Assert.assertEquals(m1, m2);
@@ -341,7 +341,7 @@ public final class BlockRealMatrixTest {
         int p = (7 * BlockRealMatrix.BLOCK_SIZE) / 2;
         int q = (5 * BlockRealMatrix.BLOCK_SIZE) / 2;
         int r =  3 * BlockRealMatrix.BLOCK_SIZE;
-        Random random = new Random(111007463902334l);
+        Random random = new Random(111007463902334L);
         RealMatrix m1 = createRandomMatrix(random, p, q);
         RealMatrix m2 = createRandomMatrix(random, q, r);
         RealMatrix m1m2 = m1.multiply(m2);
@@ -355,7 +355,7 @@ public final class BlockRealMatrixTest {
         int p = (7 * BlockRealMatrix.BLOCK_SIZE) / 2;
         int q = (5 * BlockRealMatrix.BLOCK_SIZE) / 2;
         int r =  3 * BlockRealMatrix.BLOCK_SIZE;
-        Random random = new Random(111007463902334l);
+        Random random = new Random(111007463902334L);
         RealMatrix m1 = createRandomMatrix(random, p, q);
         RealMatrix m2 = createRandomMatrix(random, q, r);
         RealMatrix m1m2 = m1.multiply(m2);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java
index 5be086e..7365b65 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/ConjugateGradientTest.java
@@ -401,8 +401,7 @@ public class ConjugateGradientTest {
             a.setEntry(i, i, daux);
             daux *= 1.2;
             for (int j = i + 1; j < n; j++) {
-                if (i == j) {
-                } else {
+                if (i != j) {
                     final double value = 1.0;
                     a.setEntry(i, j, value);
                     a.setEntry(j, i, value);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/Dfp25.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/Dfp25.java
index edadb23..97d607e 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/Dfp25.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/Dfp25.java
@@ -22,12 +22,15 @@ import org.apache.commons.math4.legacy.core.dfp.DfpField;
 /**
  * Dummy class for testing {@link org.apache.commons.math4.legacy.core.Field} functionalities.
  */
-public class Dfp25 {
+public final class Dfp25 {
     private static final DfpField FIELD = new DfpField(25);
     public static final Dfp ZERO = FIELD.newDfp(0d);
     public static final Dfp ONE = of(1d);
     public static final Dfp TWO = of(2d);
 
+    /** No instances. */
+    private Dfp25() {}
+
     public static Dfp of(double x) {
         return ZERO.newInstance(x);
     }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenDecompositionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenDecompositionTest.java
index 20ca060..436b7a4 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenDecompositionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenDecompositionTest.java
@@ -254,7 +254,7 @@ public class EigenDecompositionTest {
     /** test a matrix already in tridiagonal form. */
     @Test
     public void testTridiagonal() {
-        Random r = new Random(4366663527842l);
+        Random r = new Random(4366663527842L);
         double[] ref = new double[30];
         for (int i = 0; i < ref.length; ++i) {
             if (i < 5) {
@@ -305,7 +305,7 @@ public class EigenDecompositionTest {
     /** test eigenvalues for a big matrix. */
     @Test
     public void testBigMatrix() {
-        Random r = new Random(17748333525117l);
+        Random r = new Random(17748333525117L);
         double[] bigValues = new double[200];
         for (int i = 0; i < bigValues.length; ++i) {
             bigValues[i] = 2 * r.nextDouble() - 1;
@@ -583,8 +583,8 @@ public class EigenDecompositionTest {
         });
         EigenDecomposition ed;
         ed = new EigenDecomposition(repeated);
-        checkEigenValues((new double[] {8, -1, -1}), ed, 1E-12);
-        checkEigenVector((new double[] {2, 1, 2}), ed, 1E-12);
+        checkEigenValues(new double[] {8, -1, -1}, ed, 1E-12);
+        checkEigenVector(new double[] {2, 1, 2}, ed, 1E-12);
     }
 
     /**
@@ -599,10 +599,10 @@ public class EigenDecompositionTest {
         });
         EigenDecomposition ed;
         ed = new EigenDecomposition(distinct);
-        checkEigenValues((new double[] {2, 0, 12}), ed, 1E-12);
-        checkEigenVector((new double[] {1, -1, 0}), ed, 1E-12);
-        checkEigenVector((new double[] {1, 1, 1}), ed, 1E-12);
-        checkEigenVector((new double[] {-1, -1, 2}), ed, 1E-12);
+        checkEigenValues(new double[] {2, 0, 12}, ed, 1E-12);
+        checkEigenVector(new double[] {1, -1, 0}, ed, 1E-12);
+        checkEigenVector(new double[] {1, 1, 1}, ed, 1E-12);
+        checkEigenVector(new double[] {-1, -1, 2}, ed, 1E-12);
     }
 
     /**
@@ -617,13 +617,13 @@ public class EigenDecompositionTest {
         });
         EigenDecomposition ed;
         ed = new EigenDecomposition(indefinite);
-        checkEigenValues((new double[] {2, 1, -1}), ed, 1E-12);
+        checkEigenValues(new double[] {2, 1, -1}, ed, 1E-12);
         double isqrt3 = 1/AccurateMath.sqrt(3.0);
-        checkEigenVector((new double[] {isqrt3,isqrt3,-isqrt3}), ed, 1E-12);
+        checkEigenVector(new double[] {isqrt3,isqrt3,-isqrt3}, ed, 1E-12);
         double isqrt2 = 1/AccurateMath.sqrt(2.0);
-        checkEigenVector((new double[] {0.0,-isqrt2,-isqrt2}), ed, 1E-12);
+        checkEigenVector(new double[] {0.0,-isqrt2,-isqrt2}, ed, 1E-12);
         double isqrt6 = 1/AccurateMath.sqrt(6.0);
-        checkEigenVector((new double[] {2*isqrt6,-isqrt6,isqrt6}), ed, 1E-12);
+        checkEigenVector(new double[] {2*isqrt6,-isqrt6,isqrt6}, ed, 1E-12);
     }
 
     /**
@@ -724,7 +724,7 @@ public class EigenDecompositionTest {
         refValues = new double[] {
                 2.003, 2.002, 2.001, 1.001, 1.000, 0.001
         };
-        matrix = createTestMatrix(new Random(35992629946426l), refValues);
+        matrix = createTestMatrix(new Random(35992629946426L), refValues);
     }
 
     @After
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenSolverTest.java
index 2cf0858..f4f9e67 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/EigenSolverTest.java
@@ -36,7 +36,7 @@ public class EigenSolverTest {
     /** test non invertible matrix */
     @Test
     public void testNonInvertible() {
-        Random r = new Random(9994100315209l);
+        Random r = new Random(9994100315209L);
         RealMatrix m =
             EigenDecompositionTest.createTestMatrix(r, new double[] { 1.0, 0.0, -1.0, -2.0, -3.0 });
         DecompositionSolver es = new EigenDecomposition(m).getSolver();
@@ -52,7 +52,7 @@ public class EigenSolverTest {
     /** test invertible matrix */
     @Test
     public void testInvertible() {
-        Random r = new Random(9994100315209l);
+        Random r = new Random(9994100315209L);
         RealMatrix m =
             EigenDecompositionTest.createTestMatrix(r, new double[] { 1.0, 0.5, -1.0, -2.0, -3.0 });
         DecompositionSolver es = new EigenDecomposition(m).getSolver();
@@ -123,7 +123,7 @@ public class EigenSolverTest {
         final double[] refValues = new double[] {
             2.003, 2.002, 2.001, 1.001, 1.000, 0.001
         };
-        final RealMatrix matrix = EigenDecompositionTest.createTestMatrix(new Random(35992629946426l), refValues);
+        final RealMatrix matrix = EigenDecompositionTest.createTestMatrix(new Random(35992629946426L), refValues);
 
         DecompositionSolver es = new EigenDecomposition(matrix).getSolver();
         RealMatrix b = MatrixUtils.createRealMatrix(new double[2][2]);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java
index 1af3e5e..e540930 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java
@@ -1071,7 +1071,7 @@ public final class FieldMatrixImplTest {
     }
 
     private static class SetVisitor extends DefaultFieldMatrixChangingVisitor<Dfp> {
-        public SetVisitor() {
+        SetVisitor() {
             super(Dfp25.ZERO);
         }
         @Override
@@ -1082,7 +1082,7 @@ public final class FieldMatrixImplTest {
 
     private static class GetVisitor extends DefaultFieldMatrixPreservingVisitor<Dfp> {
         private int count;
-        public GetVisitor() {
+        GetVisitor() {
             super(Dfp25.ZERO);
             count = 0;
         }
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/MatrixUtilsTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/MatrixUtilsTest.java
index 4019ece..1404159 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/MatrixUtilsTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/MatrixUtilsTest.java
@@ -247,7 +247,7 @@ public final class MatrixUtilsTest {
         }
     }
 
-    public static final Dfp[][] asDfp(double[][] data) {
+    public static Dfp[][] asDfp(double[][] data) {
         Dfp d[][] = new Dfp[data.length][];
         for (int i = 0; i < data.length; ++i) {
             double[] dataI = data[i];
@@ -260,7 +260,7 @@ public final class MatrixUtilsTest {
         return d;
     }
 
-    public static final Dfp[] asDfp(double[] data) {
+    public static Dfp[] asDfp(double[] data) {
         Dfp d[] = new Dfp[data.length];
         for (int i = 0; i < data.length; ++i) {
             d[i] = Dfp25.of(data[i]);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java
index d209658..3afb88c 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMapTest.java
@@ -24,7 +24,6 @@ import java.util.NoSuchElementException;
 import java.util.Random;
 import java.util.Set;
 
-import org.apache.commons.math4.legacy.linear.OpenIntToDoubleHashMap;
 import org.apache.commons.numbers.core.Precision;
 import org.junit.Assert;
 import org.junit.Before;
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java
index 3a749e4..20f24ab 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/OpenIntToFieldTest.java
@@ -28,8 +28,6 @@ import java.util.Map.Entry;
 import org.apache.commons.math4.legacy.core.Field;
 import org.apache.commons.math4.legacy.core.dfp.Dfp;
 import org.apache.commons.math4.legacy.core.dfp.DfpField;
-import org.apache.commons.math4.legacy.linear.Dfp25;
-import org.apache.commons.math4.legacy.linear.OpenIntToFieldHashMap;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -64,7 +62,7 @@ public class OpenIntToFieldTest {
     private Map<Integer, Dfp> generate() {
         Map<Integer, Dfp> map = new HashMap<>();
         Random r = new Random();
-        double dd=0;
+        double dd = 0;
         for (int i = 0; i < 2000; ++i) {
             dd = r.nextDouble();
         }
@@ -318,7 +316,7 @@ public class OpenIntToFieldTest {
      */
     @Test
     public void testPutKeysWithCollision2() {
-        OpenIntToFieldHashMap<Dfp>map = new OpenIntToFieldHashMap<>(field);
+        OpenIntToFieldHashMap<Dfp> map = new OpenIntToFieldHashMap<>(field);
         int key1 = 837989881;
         Dfp value1 = Dfp25.of(1);
         map.put(key1, value1);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRDecompositionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRDecompositionTest.java
index 43b69e3..b30685a 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRDecompositionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRDecompositionTest.java
@@ -58,7 +58,7 @@ public class QRDecompositionTest {
 
         checkDimension(MatrixUtils.createRealMatrix(testData3x4));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkDimension(createTestMatrix(r, p, q));
@@ -87,7 +87,7 @@ public class QRDecompositionTest {
 
         checkAEqualQR(MatrixUtils.createRealMatrix(testData4x3));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkAEqualQR(createTestMatrix(r, p, q));
@@ -113,7 +113,7 @@ public class QRDecompositionTest {
 
         checkQOrthogonal(MatrixUtils.createRealMatrix(testData4x3));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkQOrthogonal(createTestMatrix(r, p, q));
@@ -144,7 +144,7 @@ public class QRDecompositionTest {
         matrix = MatrixUtils.createRealMatrix(testData4x3);
         checkUpperTriangular(new QRDecomposition(matrix).getR());
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         matrix = createTestMatrix(r, p, q);
@@ -181,7 +181,7 @@ public class QRDecompositionTest {
         matrix = MatrixUtils.createRealMatrix(testData4x3);
         checkTrapezoidal(new QRDecomposition(matrix).getH());
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         matrix = createTestMatrix(r, p, q);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRSolverTest.java
index 939f018..67eb2da 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/QRSolverTest.java
@@ -24,25 +24,25 @@ import org.junit.Test;
 import org.junit.Assert;
 
 public class QRSolverTest {
-    double[][] testData3x3NonSingular = {
+    private double[][] testData3x3NonSingular = {
             { 12, -51,   4 },
             {  6, 167, -68 },
             { -4,  24, -41 }
     };
 
-    double[][] testData3x3Singular = {
+    private double[][] testData3x3Singular = {
             { 1, 2,  2 },
             { 2, 4,  6 },
             { 4, 8, 12 }
     };
 
-    double[][] testData3x4 = {
+    private double[][] testData3x4 = {
             { 12, -51,   4, 1 },
             {  6, 167, -68, 2 },
             { -4,  24, -41, 3 }
     };
 
-    double[][] testData4x3 = {
+    private double[][] testData4x3 = {
             { 12, -51,   4 },
             {  6, 167, -68 },
             { -4,  24, -41 },
@@ -143,7 +143,7 @@ public class QRSolverTest {
 
     @Test
     public void testOverdetermined() {
-        final Random r    = new Random(5559252868205245l);
+        final Random r    = new Random(5559252868205245L);
         int          p    = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int          q    = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         RealMatrix   a    = createTestMatrix(r, p, q);
@@ -167,7 +167,7 @@ public class QRSolverTest {
 
     @Test
     public void testUnderdetermined() {
-        final Random r    = new Random(42185006424567123l);
+        final Random r    = new Random(42185006424567123L);
         int          p    = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int          q    = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         RealMatrix   a    = createTestMatrix(r, p, q);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRDecompositionTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRDecompositionTest.java
index bcbc555..6623bb2 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRDecompositionTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRDecompositionTest.java
@@ -58,7 +58,7 @@ public class RRQRDecompositionTest {
 
         checkDimension(MatrixUtils.createRealMatrix(testData3x4));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkDimension(createTestMatrix(r, p, q));
@@ -87,7 +87,7 @@ public class RRQRDecompositionTest {
 
         checkAPEqualQR(MatrixUtils.createRealMatrix(testData4x3));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkAPEqualQR(createTestMatrix(r, p, q));
@@ -113,7 +113,7 @@ public class RRQRDecompositionTest {
 
         checkQOrthogonal(MatrixUtils.createRealMatrix(testData4x3));
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         checkQOrthogonal(createTestMatrix(r, p, q));
@@ -144,7 +144,7 @@ public class RRQRDecompositionTest {
         matrix = MatrixUtils.createRealMatrix(testData4x3);
         checkUpperTriangular(new RRQRDecomposition(matrix).getR());
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         matrix = createTestMatrix(r, p, q);
@@ -181,7 +181,7 @@ public class RRQRDecompositionTest {
         matrix = MatrixUtils.createRealMatrix(testData4x3);
         checkTrapezoidal(new RRQRDecomposition(matrix).getH());
 
-        Random r = new Random(643895747384642l);
+        Random r = new Random(643895747384642L);
         int    p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int    q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         matrix = createTestMatrix(r, p, q);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRSolverTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRSolverTest.java
index 1a6119a..fc9af75 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRSolverTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RRQRSolverTest.java
@@ -24,25 +24,25 @@ import org.junit.Test;
 import org.junit.Assert;
 
 public class RRQRSolverTest {
-    double[][] testData3x3NonSingular = {
+    private double[][] testData3x3NonSingular = {
             { 12, -51,   4 },
             {  6, 167, -68 },
             { -4,  24, -41 }
     };
 
-    double[][] testData3x3Singular = {
+    private double[][] testData3x3Singular = {
             { 1, 2,  2 },
             { 2, 4,  6 },
             { 4, 8, 12 }
     };
 
-    double[][] testData3x4 = {
+    private double[][] testData3x4 = {
             { 12, -51,   4, 1 },
             {  6, 167, -68, 2 },
             { -4,  24, -41, 3 }
     };
 
-    double[][] testData4x3 = {
+    private double[][] testData4x3 = {
             { 12, -51,   4 },
             {  6, 167, -68 },
             { -4,  24, -41 },
@@ -146,7 +146,7 @@ public class RRQRSolverTest {
 
     @Test
     public void testOverdetermined() {
-        final Random r    = new Random(5559252868205245l);
+        final Random r    = new Random(5559252868205245L);
         int          p    = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int          q    = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         RealMatrix   a    = createTestMatrix(r, p, q);
@@ -170,7 +170,7 @@ public class RRQRSolverTest {
 
     @Test
     public void testUnderdetermined() {
-        final Random r    = new Random(42185006424567123l);
+        final Random r    = new Random(42185006424567123L);
         int          p    = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
         int          q    = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
         RealMatrix   a    = createTestMatrix(r, p, q);
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealMatrixFormatAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealMatrixFormatAbstractTest.java
index dbc8879..e5a2302 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealMatrixFormatAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealMatrixFormatAbstractTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.math4.legacy.exception.MathParseException;
 
 public abstract class RealMatrixFormatAbstractTest {
 
-    RealMatrixFormat realMatrixFormat = null;
-    RealMatrixFormat realMatrixFormatOctave = null;
+    private RealMatrixFormat realMatrixFormat = null;
+    private RealMatrixFormat realMatrixFormatOctave = null;
 
     protected abstract Locale getLocale();
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorFormatAbstractTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorFormatAbstractTest.java
index 4fc542b..ccb2ad6 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorFormatAbstractTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorFormatAbstractTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.math4.legacy.exception.MathParseException;
 
 public abstract class RealVectorFormatAbstractTest {
 
-    RealVectorFormat realVectorFormat = null;
-    RealVectorFormat realVectorFormatSquare = null;
+    private RealVectorFormat realVectorFormat = null;
+    private RealVectorFormat realVectorFormatSquare = null;
 
     protected abstract Locale getLocale();
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorTest.java
index b499ebb..6ff3f6e 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorTest.java
@@ -211,7 +211,7 @@ public class RealVectorTest extends RealVectorAbstractTest{
         }
... 2451 lines suppressed ...