[hibernate-issues] [Hibernate-JIRA] Commented: (HV-585) Order of validation messages is lost
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Fri May 11 06:54:09 EDT 2012
[ https://hibernate.onjira.com/browse/HV-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46610#comment-46610 ]
Hardy Ferentschik commented on HV-585:
--------------------------------------
Ok, got you.As said, the problem is that the spec does not guarantee an order, also not in the context of _ConstraintValidatorContext_. I guess we could just use a _LinkedHashSet_, but then you would be relying on something which is not portable. Also this order makes only sense in conjunction with _ConstraintValidatorContext_. The order in which constraints are evaluated is still undefined.
> Order of validation messages is lost
> ------------------------------------
>
> Key: HV-585
> URL: https://hibernate.onjira.com/browse/HV-585
> Project: Hibernate Validator
> Issue Type: Improvement
> Components: engine
> Affects Versions: 4.3.0.Final
> Environment: ---
> Reporter: Gunther Schmidl
> Labels: hibernate, validation
>
> When adding validation messages, they are stored in an ArrayList. Later on, they are transferred to a HashSet, and finally to a String[] array. Naturally, putting them in a HashSet screws up the order of the messages, which may be important (for example, I have a "header" error message I wish to display first). Please consider changing the HashSet to a LinkedHashSet.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list