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 e23ed4f00634cb307fcc3a0b2b3427ebbf512e1a Author: Alex Herbert <aherb...@apache.org> AuthorDate: Mon Mar 24 15:27:55 2025 +0000 Sonar fix: Replace lambda with function reference --- .../apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java | 2 +- .../org/apache/commons/statistics/descriptive/BaseIntStatisticTest.java | 2 +- .../apache/commons/statistics/descriptive/BaseLongStatisticTest.java | 2 +- .../org/apache/commons/statistics/descriptive/DoubleStatisticsTest.java | 2 +- .../org/apache/commons/statistics/descriptive/IntStatisticsTest.java | 2 +- .../org/apache/commons/statistics/descriptive/LongStatisticsTest.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java index ad99f2a..4deda62 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java @@ -1282,7 +1282,7 @@ abstract class BaseDoubleStatisticTest<S extends DoubleStatistic & StatisticAccu final S empty = create(); assertStatistic(v -> Arrays.stream(values) - .mapToObj(x -> create(x)) + .mapToObj(this::create) .reduce(empty, this::assertCombine), values, expected, tol); } diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseIntStatisticTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseIntStatisticTest.java index 56e826e..b2a7276 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseIntStatisticTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseIntStatisticTest.java @@ -1171,7 +1171,7 @@ abstract class BaseIntStatisticTest<S extends IntStatistic & StatisticAccumulato final S empty = create(); assertStatistic(v -> Arrays.stream(values) - .mapToObj(x -> create(x)) + .mapToObj(this::create) .reduce(empty, this::assertCombine), values, expected, tol); } diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseLongStatisticTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseLongStatisticTest.java index 5072007..73fa565 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseLongStatisticTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseLongStatisticTest.java @@ -1170,7 +1170,7 @@ abstract class BaseLongStatisticTest<S extends LongStatistic & StatisticAccumula final S empty = create(); assertStatistic(v -> Arrays.stream(values) - .mapToObj(x -> create(x)) + .mapToObj(this::create) .reduce(empty, this::assertCombine), values, expected, tol); } diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/DoubleStatisticsTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/DoubleStatisticsTest.java index 57255bc..9820b85 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/DoubleStatisticsTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/DoubleStatisticsTest.java @@ -561,7 +561,7 @@ class DoubleStatisticsTest { for (final Statistic s : stat1) { final double expected = statistics1.getAsDouble(s); assertFinite(expected, s); - Assertions.assertEquals(expected, statistics2.getAsDouble(s), () -> s.toString()); + Assertions.assertEquals(expected, statistics2.getAsDouble(s), s::toString); } } diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntStatisticsTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntStatisticsTest.java index f52081a..4eedd6f 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntStatisticsTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntStatisticsTest.java @@ -615,7 +615,7 @@ class IntStatisticsTest { for (final Statistic s : stat1) { final double expected = statistics1.getAsDouble(s); assertFinite(expected, s); - Assertions.assertEquals(expected, statistics2.getAsDouble(s), () -> s.toString()); + Assertions.assertEquals(expected, statistics2.getAsDouble(s), s::toString); } } diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongStatisticsTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongStatisticsTest.java index e7192f2..8c390de 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongStatisticsTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongStatisticsTest.java @@ -615,7 +615,7 @@ class LongStatisticsTest { for (final Statistic s : stat1) { final double expected = statistics1.getAsDouble(s); assertFinite(expected, s); - Assertions.assertEquals(expected, statistics2.getAsDouble(s), () -> s.toString()); + Assertions.assertEquals(expected, statistics2.getAsDouble(s), s::toString); } }