You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/org/apache/commons/validator/routines/BigIntegerValidator.java
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,8 @@ public boolean maxValue(final BigInteger value, final long max) {
152
152
* <p>
153
153
* This overrides the {@link Number} overload inherited from the superclass, which narrows the value to a {@code long} before comparing and so loses
154
154
* magnitude for a {@code BigInteger} outside the long range. The operands are compared as {@code BigDecimal} so a non-integer bound keeps its fractional
155
-
* part instead of being truncated towards zero.
155
+
* part instead of being truncated towards zero. A non-finite {@link Double} or {@link Float} operand keeps the {@code doubleValue()} comparison, since
156
+
* {@code BigDecimal} cannot represent {@code NaN} or an infinity.
156
157
* </p>
157
158
*
158
159
* @param value The value validation is being performed on.
@@ -161,7 +162,7 @@ public boolean maxValue(final BigInteger value, final long max) {
@@ -181,7 +182,8 @@ public boolean minValue(final BigInteger value, final long min) {
181
182
* <p>
182
183
* This overrides the {@link Number} overload inherited from the superclass, which narrows the value to a {@code long} before comparing and so loses
183
184
* magnitude for a {@code BigInteger} outside the long range. The operands are compared as {@code BigDecimal} so a non-integer bound keeps its fractional
184
-
* part instead of being truncated towards zero.
185
+
* part instead of being truncated towards zero. A non-finite {@link Double} or {@link Float} operand keeps the {@code doubleValue()} comparison, since
186
+
* {@code BigDecimal} cannot represent {@code NaN} or an infinity.
185
187
* </p>
186
188
*
187
189
* @param value The value validation is being performed on.
@@ -190,7 +192,7 @@ public boolean minValue(final BigInteger value, final long min) {
* A non-finite {@link Double} bound must not be routed through {@link BigDecimal}, which cannot represent {@code NaN} or an infinity. The {@link Number}
244
+
* overloads previously converted every bound to a {@code BigDecimal} and so threw {@code NumberFormatException} for such a bound, whereas the sibling
245
+
* {@link BigDecimalValidator} already handled it. The behaviour now matches: a {@code NaN} bound is never satisfied, and an infinity is an open bound.
0 commit comments