Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@spring-issuemaster
Copy link

@spring-issuemaster spring-issuemaster commented Nov 19, 2009

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 {

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

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

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

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

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

Alex Peters said:

i attachted a sample impl

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

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.

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

Luke Taylor said:

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

@spring-issuemaster

This comment has been minimized.

Copy link
Author

@spring-issuemaster spring-issuemaster commented Nov 30, 2009

Alex Peters said:

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.