From 1b53f09c3a9dcd64dd281c1955b062fc28999366 Mon Sep 17 00:00:00 2001 From: Gilles Date: Thu, 15 Jun 2017 14:21:21 +0200 Subject: [PATCH] MATH-1419 --- src/changes/changes.xml | 3 +++ .../math4/analysis/polynomials/PolynomialSplineFunction.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 90df1e132..9e4f57965 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -54,6 +54,9 @@ If the output is not quite correct, check for invisible trailing spaces! + + "PolynomialSplineFunction": incorrect usage of exception. + add generics to the Frequency class diff --git a/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialSplineFunction.java b/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialSplineFunction.java index b842a407f..d7263c2fd 100644 --- a/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialSplineFunction.java +++ b/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialSplineFunction.java @@ -105,7 +105,7 @@ public class PolynomialSplineFunction implements UnivariateDifferentiableFunctio } if (knots.length < 2) { throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION, - 2, knots.length, false); + knots.length, 2, true); } if (knots.length - 1 != polynomials.length) { throw new DimensionMismatchException(polynomials.length, knots.length);