| This is still an issue in Hibernate 4 and 5 (up to 5.2.2). And it is actually a bit worse than the original reporter stated. The SetProxy implementation actually breaks the contract of java.util.Set.equals():
Compares the specified object with this set for equality. Returns true if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set interface.
I will attach test cases as soon as I can (either that is not possible for closed tickets or I don't have the permission yet). |