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-statistics.git
commit 3ccbfd9a003028e6a3af73584a11fb7b6e4449f5 Author: Alex Herbert <aherb...@apache.org> AuthorDate: Fri May 16 14:07:31 2025 +0100 PMD fix: Add FunctionalInterface annotation --- .../java/org/apache/commons/statistics/descriptive/NaNTransformer.java | 1 + .../org/apache/commons/statistics/descriptive/StatisticAccumulator.java | 1 + .../commons/statistics/inference/KolmogorovSmirnovDistribution.java | 1 + .../org/apache/commons/statistics/inference/UnconditionedExactTest.java | 1 + 4 files changed, 4 insertions(+) diff --git a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/NaNTransformer.java b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/NaNTransformer.java index 5b687b6..79174b6 100644 --- a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/NaNTransformer.java +++ b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/NaNTransformer.java @@ -39,6 +39,7 @@ package org.apache.commons.statistics.descriptive; * <p>This interface allows implementations to respect the behaviour of * {@link Double#compare(double, double)}, or implement different behaviour. */ +@FunctionalInterface interface NaNTransformer { /** * Pre-process the data for partitioning. diff --git a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/StatisticAccumulator.java b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/StatisticAccumulator.java index 693396d..6bc22f9 100644 --- a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/StatisticAccumulator.java +++ b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/StatisticAccumulator.java @@ -23,6 +23,7 @@ package org.apache.commons.statistics.descriptive; * * @since 1.1 */ +@FunctionalInterface public interface StatisticAccumulator<T extends StatisticResult> { /** diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java index 9de9b7a..4c4ac89 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java @@ -706,6 +706,7 @@ final class KolmogorovSmirnovDistribution { * Defines a scaled power function. * Package-private to allow the main sf method to be called direct in testing. */ + @FunctionalInterface interface ScaledPower { /** * Compute the number {@code x} raised to the power {@code n}. diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/UnconditionedExactTest.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/UnconditionedExactTest.java index 51e63ca..06c703b 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/UnconditionedExactTest.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/UnconditionedExactTest.java @@ -517,6 +517,7 @@ public final class UnconditionedExactTest { /** * Compute the statistic for Boschloo's test. */ + @FunctionalInterface private interface BoschlooStatistic { /** * Compute Fisher's p-value for the 2x2 contingency table with the observed