Description
In PolynomialSplineFunction constructor, it tests whether length of knots is smaller than 2 or not. If <2, it throws NumberIsTooSmallException like below:
if (knots.length < 2) { throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION, 2, knots.length, false); }
But definition of above exception has parameters of the form:
/** * Construct the exception with a specific context. * * @param specific Specific context pattern. * @param wrong Value that is smaller than the minimum. * @param min Minimum. * @param boundIsAllowed Whether {@code min} is included in the allowed range. */ public NumberIsTooSmallException(Localizable specific, Number wrong, Number min, boolean boundIsAllowed) { super(specific, wrong, min); this.min = min; this.boundIsAllowed = boundIsAllowed; }
In my opinion, 2, knots.length, false should be knots.length, 2, true
since 2 is the minimum value and knots.length is the wrong value in this case. Moreover, boolean should be set by true because 2 is also acceptable.