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 <aherb...@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>