AbstractPersistentCollection.SetProxy implements java.util.Set interface, but does not define equals(), so this set cannot be properly compared.
I have a persistent Map, and invoke keySet() twice, each invocation returns new instance of SetProxy. If I perform equals() for these two sets after it, I have false.
this seem to be the case for all the <somecollection>Proxy classes in AbstractPersistentCollection....
In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.
Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!
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).