diff --git a/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java b/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java index 72db02639..585f02cc8 100644 --- a/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java +++ b/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java @@ -79,9 +79,9 @@ public abstract class AbstractUnivariateStatistic final double[] values, final int begin, final int length) { - return test(values, begin, length, false); + return test(values, begin, length, false); } - + /** * This method is used by evaluate(double[], int, int) methods * to verify that the input parameters designate a subarray of positive length. @@ -105,28 +105,28 @@ public abstract class AbstractUnivariateStatistic */ protected boolean test(final double[] values, final int begin, final int length, final boolean allowEmpty){ - if (values == null) { - throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); - } + if (values == null) { + throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); + } - if (begin < 0) { - throw new NotPositiveException(LocalizedFormats.START_POSITION, begin); - } + if (begin < 0) { + throw new NotPositiveException(LocalizedFormats.START_POSITION, begin); + } - if (length < 0) { - throw new NotPositiveException(LocalizedFormats.LENGTH, length); - } + if (length < 0) { + throw new NotPositiveException(LocalizedFormats.LENGTH, length); + } - if (begin + length > values.length) { - throw MathRuntimeException.createIllegalArgumentException( - LocalizedFormats.SUBARRAY_ENDS_AFTER_ARRAY_END); - } + if (begin + length > values.length) { + throw MathRuntimeException.createIllegalArgumentException( + LocalizedFormats.SUBARRAY_ENDS_AFTER_ARRAY_END); + } - if (length == 0 && !allowEmpty) { - return false; - } + if (length == 0 && !allowEmpty) { + return false; + } - return true; + return true; } @@ -164,9 +164,9 @@ public abstract class AbstractUnivariateStatistic final double[] weights, final int begin, final int length) { - return test(values, weights, begin, length, false); + return test(values, weights, begin, length, false); } - + /** * This method is used by evaluate(double[], double[], int, int) methods * to verify that the begin and length parameters designate a subarray of positive length @@ -219,7 +219,7 @@ public abstract class AbstractUnivariateStatistic } if (weights[i] < 0) { throw MathRuntimeException.createIllegalArgumentException( - LocalizedFormats.NEGATIVE_ELEMENT_AT_INDEX, i, weights[i]); + LocalizedFormats.NEGATIVE_ELEMENT_AT_INDEX, i, weights[i]); } if (!containsPositiveWeight && weights[i] > 0.0) { containsPositiveWeight = true; diff --git a/src/test/java/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java b/src/test/java/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java index 5785e344e..9e0214e1a 100644 --- a/src/test/java/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java +++ b/src/test/java/org/apache/commons/math/stat/descriptive/StorelessUnivariateStatisticAbstractTest.java @@ -74,7 +74,7 @@ public abstract class StorelessUnivariateStatisticAbstractTest } protected void checkClearValue(StorelessUnivariateStatistic statistic){ - assertTrue(Double.isNaN(statistic.getResult())); + assertTrue(Double.isNaN(statistic.getResult())); } public void testSerialization() throws Exception { diff --git a/src/test/java/org/apache/commons/math/stat/descriptive/summary/ProductTest.java b/src/test/java/org/apache/commons/math/stat/descriptive/summary/ProductTest.java index 0f85d556d..183be71a0 100644 --- a/src/test/java/org/apache/commons/math/stat/descriptive/summary/ProductTest.java +++ b/src/test/java/org/apache/commons/math/stat/descriptive/summary/ProductTest.java @@ -86,8 +86,8 @@ public class ProductTest extends StorelessUnivariateStatisticAbstractTest{ } protected void checkClearValue(StorelessUnivariateStatistic statistic){ - assertEquals(1, statistic.getResult(), 0); + assertEquals(1, statistic.getResult(), 0); } - + } diff --git a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumLogTest.java b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumLogTest.java index d822e955f..e7b42c600 100644 --- a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumLogTest.java +++ b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumLogTest.java @@ -82,7 +82,7 @@ public class SumLogTest extends StorelessUnivariateStatisticAbstractTest{ } protected void checkClearValue(StorelessUnivariateStatistic statistic){ - assertEquals(0, statistic.getResult(), 0); + assertEquals(0, statistic.getResult(), 0); } diff --git a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumSqTest.java b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumSqTest.java index 727ca5db7..64404860f 100644 --- a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumSqTest.java +++ b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumSqTest.java @@ -68,8 +68,8 @@ public class SumSqTest extends StorelessUnivariateStatisticAbstractTest{ } protected void checkClearValue(StorelessUnivariateStatistic statistic){ - assertEquals(0, statistic.getResult(), 0); + assertEquals(0, statistic.getResult(), 0); } - + } diff --git a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumTest.java b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumTest.java index 18a425215..a9162f957 100644 --- a/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumTest.java +++ b/src/test/java/org/apache/commons/math/stat/descriptive/summary/SumTest.java @@ -76,8 +76,8 @@ public class SumTest extends StorelessUnivariateStatisticAbstractTest{ } protected void checkClearValue(StorelessUnivariateStatistic statistic){ - assertEquals(0, statistic.getResult(), 0); + assertEquals(0, statistic.getResult(), 0); } - + }