Hardy Ferentschik edited a comment on Improvement HV-585

Right, I'm saying it would be nice to have the option of a guaranteed order. As an example, in my current application, I add five constraint violations at once if specific conditions are not met, so you would get something like:

Invalid password: {numMin} of the following conditions must be met:
At least {numLC} lowercase characters.
At least {numUC} uppercase characters.
At least {numSC} special characters.
At least {numNC} digits.

I am adding these constraints using validatorContext.buildConstraintViolationWithTemplate(message).addConstraintViolation(), which puts the items in an ArrayList. Later, they are moved to a HashSet, and then to a String[] array for display.

So the question is: why keep order intact when adding constraints (ArrayList) and displaying constraints (String[]), but not in between?

Obviously, the HashSet randomly jumbles the order of messages, which then make no sense. Using a LinkedHashSet in the implementation instead would keep the order intact.

As it is, I am currently implementing my own <custom:errors> JSP tag which sorts the messages by a number prefix it then removes, which is of course suboptimal.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira