Manuel Dominguez Sarmiento (Migrated from SEC-1347) said:
GrantedAuthorityImpl has a compareTo() method which I guess is supposed to be the implementation of Comparable, however this interface is nowhere to be found in the class hierarchy.
We found out because UserDetails.getAuthorities() : Collection is supposed to return elements "sorted by natural key" and we thought about using a TreeSet in our implementation, but of course this would only work if the GrantedAuthorityImpl objects we put in it implement Comparable, which they don't. We use a LinkedHashSet instead as a workaround, pre-sorting elements before insertion.
BTW, what's the reasoning behind the "sorted by natural key" requirement for iterating through authorities?
Luke Taylor said:
Please see SEC-1304 and SEC-717. The compareTo() method has been left in by mistake and should be removed.
Removed the compareTo method as part of the original issue.