[
https://issues.apache.org/jira/browse/BVAL-15?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carlos Vara updated BVAL-15:
----------------------------
Attachment: MinMaxValidatorsForNumberTest.java
minmaxfix.diff
I attach a test case that shows the problem, and a diff with the fix.
Also, the fix is more in accordance with the spec which says that float/double
values may not be correctly supported because of rounding errors, but integers
should always work.
> @Min and @Max fail with very high values of long
> ------------------------------------------------
>
> Key: BVAL-15
> URL: https://issues.apache.org/jira/browse/BVAL-15
> Project: BeanValidation
> Issue Type: Bug
> Components: jsr303
> Affects Versions: 0.1-incubating
> Reporter: Carlos Vara
> Attachments: minmaxfix.diff, MinMaxValidatorsForNumberTest.java
>
>
> Current implementations of MinValidationForNumber and MaxValidatorForNumber
> fail when comparing very high long values. The reason is that they cast the
> value to a double before comparing, so long values that cast to the same
> double value may fail.
> On a side note: Hibernate Validator has the same problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.