MATH-1565: Add context to "OutOfRangeException" so as to produce a complete message.

This commit is contained in:
Gilles Sadowski 2020-12-11 18:34:42 +01:00
parent 649b134f17
commit 323f6d7153
2 changed files with 8 additions and 4 deletions

View File

@ -54,6 +54,9 @@ If the output is not quite correct, check for invisible trailing spaces!
</release> </release>
<release version="4.0" date="XXXX-XX-XX" description=""> <release version="4.0" date="XXXX-XX-XX" description="">
<action dev="erans" type="fix" issue="MATH-1565">
Add context to "OutOfRangeException".
</action>
<action dev="erans" type="update" issue="MATH-1562" due-to="Frank Ulbricht"> <action dev="erans" type="update" issue="MATH-1562" due-to="Frank Ulbricht">
Add "Automatic-Module-Name" entry to JAR manifest file. Add "Automatic-Module-Name" entry to JAR manifest file.
</action> </action>

View File

@ -42,7 +42,9 @@ public class OutOfRangeException extends MathIllegalNumberException {
public OutOfRangeException(Number wrong, public OutOfRangeException(Number wrong,
Number lo, Number lo,
Number hi) { Number hi) {
this(LocalizedFormats.OUT_OF_RANGE_SIMPLE, wrong, lo, hi); super(LocalizedFormats.OUT_OF_RANGE_SIMPLE, wrong, lo, hi);
this.lo = lo;
this.hi = hi;
} }
/** /**
@ -58,9 +60,8 @@ public class OutOfRangeException extends MathIllegalNumberException {
Number wrong, Number wrong,
Number lo, Number lo,
Number hi) { Number hi) {
super(specific, wrong, lo, hi); this(wrong, lo, hi);
this.lo = lo; getContext().addMessage(specific, wrong, lo, hi);
this.hi = hi;
} }
/** /**