mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-25 09:28:23 +00:00
Suppress Compiler Warnings
This commit is contained in:
parent
8cefc8a792
commit
6499a235b0
@ -39,6 +39,7 @@ public interface OAuth2AuthenticatedPrincipal extends AuthenticatedPrincipal {
|
||||
* @return the attribute or {@code null} otherwise
|
||||
*/
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
default <A> A getAttribute(String name) {
|
||||
return (A) getAttributes().get(name);
|
||||
}
|
||||
|
@ -118,9 +118,14 @@ public final class JwtGrantedAuthoritiesConverter implements Converter<Jwt, Coll
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (authorities instanceof Collection) {
|
||||
return (Collection<String>) authorities;
|
||||
return castAuthoritiesToCollection(authorities);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Collection<String> castAuthoritiesToCollection(Object authorities) {
|
||||
return (Collection<String>) authorities;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user