AbstractPersistentCollection.SetProxy does not implement equals()

Description

As I couldn't add a testcase to the closed and couldn't reopen it, I cloned it.

AbstractPersistentCollection.SetProxy implements java.util.Set interface, but does not define equals(), thereby breaking 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.

Even two consequtive calls to somePersistentMap.keySet() produce two instances of SetProxy which are not equal to another.

Environment

None

Activity

Show:
Nikolai Schreier
June 9, 2017, 11:16 AM
Edited

Test case is attached.

Assignee

Unassigned

Reporter

Nikolai Schreier

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure