sahvx655-wq commented on PR #410:
URL: 
https://github.com/apache/commons-validator/pull/410#issuecomment-4862828727

   Sorry this sat red for a week. Chased down the CI failure: only the JDK 8 
job actually failed, the rest of the matrix was cancelled by fail-fast, so it 
looked worse than it was. The culprit was my own 
testFloatNumberRangeExactBound. A float at 2^53 has a round-trip interval about 
a float ULP wide (~10^9 there), and compareTo runs the value through 
toBigDecimal, which for a Float goes via Float.toString. JDK 19+ emits the 
shortest form (9.007199E15) while JDK 8's older algorithm emits the exact 2^53, 
and my bound sat between the two, so the assertion flipped by JDK.
   
   The deeper problem is that any bound precise enough to trigger the 
double-narrowing bug has to fall within one double ULP of the value, which at 
that magnitude is always inside the float's round-trip interval, so there's no 
portable way to pin the float override in a test. I've dropped FloatValidator 
and scoped the PR to Double, where doubleValue() is exact and the test is 
stable (it already passed on JDK 8). The Double overrides defer to the 
superclass compareTo(Number, Number) and the inherited isFinite(Number) as you 
asked, and the test bound is BigDecimal.valueOf(...). mvn clean verify is green 
locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to