garydgregory commented on PR #384:
URL:
https://github.com/apache/commons-validator/pull/384#issuecomment-4621628824
@sahvx655-wq
Did you read the Javadoc?
This looks like you or your AI are imagining requirements that don't exist
or that I can't find.
For example, "NaN" is a valid value to parse with a `NumberFormat` (which we
use):
```
jshell> import java.text.*;
jshell> NumberFormat.getInstance().parse("NaN");
$3 ==> NaN
```
But it's not the same for `Double.POSITIVE_INFINITY`:
```
jshell> NumberFormat.getInstance().parse("" + Double.POSITIVE_INFINITY)
| Exception java.text.ParseException: Unparseable number: "+Infinity"
| at NumberFormat.parse (NumberFormat.java:434)
| at (#2:1)
```
So there is a discrepancy...
Aside from the issue that the PR this may break existing applications, how
do you propose an app use this class to validate, for example, config file
values, or user input where in fact, a Double value like `Double.NaN` is
expected?
FYI, I updated tests for edge case tests in `FloatValidatorTest` and
`DoubleValidatorTest` to reflect the current code.
TY!
--
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]