Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SEC-1304: Remove Comparable from GrantedAuthority to allow Enum impl #1549

spring-issuemaster opened this Issue Nov 19, 2009 · 6 comments


None yet
1 participant

Alex Peters (Migrated from SEC-1304) said:

it would be great to have my enum implement the GrantedAuthority interface. currently this is not possible because of the typed Comparable. a more generic approach works:

interface GrantedAuthority<T extends GrantedAuthority<?>> extends Serializable, Comparable {

Luke Taylor said:

This appears to cause compiler errors and warnings (requiring parameterization of GrantedAuthority) if substituted for the existing code.

Could you be more specific about how you get it to work?

Luke Taylor said:

Actually, I'm not sure we need the Comparable on GrantedAuthority. It was introduced for SEC-717. Since we now use a Collection for getAuthorities() methods, I don't really see that a specific ordering should be required. The current places where the authorities are loaded could achieve the same result using a Comparator.

Alex Peters said:

i attachted a sample impl

Luke Taylor said:

Having to implement GrantedAuthority<GrantedAuthority<?>>, rather than just GrantedAuthority seems to me like it would be confusing for people (it is for me :) ).

I would prefer just to roll back the addition of Comparable from SEC-717.

Luke Taylor said:

I've removed the Comparable interface. I don't think this should cause any problems.

Alex Peters said:

thank you!

@spring-issuemaster spring-issuemaster added this to the 3.0.0.RC2 milestone Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment