|
|
|
In {{ValidationContext$BeanAndPath}} we shouldn't rely on the {{hashCode()}} implementation of entities but rely on the actual object identity involved entities . This makes sure the logic works correctly also in case of collisions of the hashes from different objects, e.g. in cases where objects of different types have the same hash code.
Also see See [this post|http://stackoverflow.com/questions/20789369/why-does-valid-cause-a-reentrant-flush?noredirect=1#comment31350080_20789369] on SO, where the access to {{hashCode()}} causes an unwanted flush to the database.
I think we should be on the safe side by using {{System#identityHashCode()}} instead to get a distribution within the map, {{BeanAndPath#equals()}} is already based on the object reference identity correctly.
|
|
|
|