We have an {{OrderedSet}} which basically is a {{Set}} allowing index based access with the {{List}} interface (or a {{List}} with additional {{Set}} semantics). The implemented looks like this:
{code:java} public class OrderedSet<E> extends ArrayList<E> implements Set<E> { ... implementation itself is not relevant for this test case... } {code}
When such an implementation is used with a {{List}} property
{code:java} @Valid public List<...> getDataAsList() // return instance of OrderedSet {code}
we do get the expected results: {code:java}dataAsList[42]....{code} if something is invalid.
However if you use it with a {{Set}} property
{code:java} @Valid public Set<...> getDataAsSet() // return instance of OrderedSet {code}
the index based access is no longer supported and we only get {code:java}dataAsSet[]....{code}
Please note that both versions returned an index in 5.4.2.
You may find a test case here: https://github.com/abenneke/sandbox/tree/master/hibernate-validator-listset |
|