org.hibernate.type.SortedSetType does not overwrite instantiate(int anticipatedSize)

Description

org.hibernate.type.SortedSetType inherits the implementation of instantiate(int anticipatedSize) from org.hibernate.type.SetType. In the effect, a java.util.HashSet gets instatiated instead of a java.util.TreeSet. Collections mapped with sort="natural" or sort="<T implements java.util.Comparator>" will never be sorted once they are retrieved from the database. Since is is neither possible nor makes it sense to create a TreeSet with an initial size, the missing implementation of instantiate(int anticipatedSize) may safely ignore the argument and delegate to instantiate().

Environment

Hibernate 3.2.0.cr3, affects all environments

Assignee

Unassigned

Reporter

Stefan Schulze

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

Critical
Configure