-
Notifications
You must be signed in to change notification settings - Fork 6.3k
SEC-1908: Remove bounded wildcard return types #2127
Copy link
Copy link
Open
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-corein: ldapAn issue in spring-security-ldapAn issue in spring-security-ldaptype: breaks-passivityA change that breaks passivity with the previous releaseA change that breaks passivity with the previous releasetype: jiraAn issue that was migrated from JIRAAn issue that was migrated from JIRA
Metadata
Metadata
Assignees
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-corein: ldapAn issue in spring-security-ldapAn issue in spring-security-ldaptype: breaks-passivityA change that breaks passivity with the previous releaseA change that breaks passivity with the previous releasetype: jiraAn issue that was migrated from JIRAAn issue that was migrated from JIRA
Type
Fields
Give feedbackNo fields configured for issues without a type.
Mikhail Mazursky (Migrated from SEC-1908) said:
I was updating spring 3.0.x to 3.1.0 and one of my tests (with Mockito) showed a compilation error. The problem i encountered was the same as described here 1:
This is not type safe but that problem can be worked around by:
The question is should the LdapAuthoritiesPopulator interface's method getGrantedAuthorities have a bounded wildcard return type or not? I think it's better to remove wildcard as it gives nothing to the calling code.
Spring 3.0.x have it as:
The same problem with GrantedAuthoritiesMapper, GrantedAuthoritiesContainer, Attributes2GrantedAuthoritiesMapper, WebSpherePreAuthenticatedWebAuthenticationDetailsSource and possibly some other classes/ifaces.
Interesting reading on the topic 2.
Methods with bounded wildcard return types
PUBLIC
PROTECTED
DEFAULT
PRIVATE