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

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

1 participant

@spring-issuemaster

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> extends Serializable, Comparable {

@spring-issuemaster

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?

@spring-issuemaster

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.

@spring-issuemaster

Alex Peters said:

i attachted a sample impl

@spring-issuemaster

Luke Taylor said:

Having to implement 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.

@spring-issuemaster

Luke Taylor said:

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

@spring-issuemaster

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