[hibernate-issues] [Hibernate-JIRA] Commented: (HV-585) Order of validation messages is lost
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Thu May 10 10:40:09 EDT 2012
[ https://hibernate.onjira.com/browse/HV-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46597#comment-46597 ]
Hardy Ferentschik commented on HV-585:
--------------------------------------
Could you be more specific what you are referring to? Bean Validation generally does not guarantee any order of _ConstraintViolations_ (or error messages). The validate method has the signature _Set<ConstraintViolation<T>> validate(T object, Class<?>... groups);_. Or maybe you are referring composed constraints. However, there is no guarantee about order either.
Maybe it helps if you would just be more specific.
> 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