Announcement Announcement Module
No announcement yet.
getAuthorities returns ordered collection Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • getAuthorities returns ordered collection

    For writing custom implementation of UserDetails, why does the getAuthorities method require the collection to be returned to be sorted?

    the authorities, sorted by natural key (never null)
    Is it mandatory requirement or just good-to-have-for-performance kind of thing?

    If it is mandatory then why is it not dictated by the type of interface being used for the return type. Instead of Collection<GrantedAuthority> it could have been SortedSet<GrantedAuthority>.

    I searched a lot but most of the time i am getting results for older api which used to return the array.

    Thanks in advance

  • #2
    No, it shouldn't matter. It was originally a requirement because of issue SEC-717.