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
The following commit(s) were added to refs/heads/master by this push: new c982c3a Use lambda function c982c3a is described below commit c982c3a5d7988a3692398c4f869545c7ee71ba6a Author: aherbert <aherb...@apache.org> AuthorDate: Tue Dec 6 18:14:58 2022 +0000 Use lambda function --- .../java/org/apache/commons/statistics/ranking/NaturalRanking.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/commons-statistics-ranking/src/main/java/org/apache/commons/statistics/ranking/NaturalRanking.java b/commons-statistics-ranking/src/main/java/org/apache/commons/statistics/ranking/NaturalRanking.java index c729bd1..af7e08f 100644 --- a/commons-statistics-ranking/src/main/java/org/apache/commons/statistics/ranking/NaturalRanking.java +++ b/commons-statistics-ranking/src/main/java/org/apache/commons/statistics/ranking/NaturalRanking.java @@ -93,11 +93,8 @@ public class NaturalRanking implements RankingAlgorithm { /** Map values to negative infinity. */ private static final DoubleUnaryOperator ACTION_NEG_INF = x -> Double.NEGATIVE_INFINITY; /** Raise an exception for values. */ - private static final DoubleUnaryOperator ACTION_ERROR = new DoubleUnaryOperator() { - @Override - public double applyAsDouble(double operand) { - throw new IllegalArgumentException("Invalid data: " + operand); - } + private static final DoubleUnaryOperator ACTION_ERROR = operand -> { + throw new IllegalArgumentException("Invalid data: " + operand); }; /** NaN strategy. */