mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 09:12:14 +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
|
* @return the attribute or {@code null} otherwise
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
default <A> A getAttribute(String name) {
|
default <A> A getAttribute(String name) {
|
||||||
return (A) getAttributes().get(name);
|
return (A) getAttributes().get(name);
|
||||||
}
|
}
|
||||||
|
@ -118,9 +118,14 @@ public final class JwtGrantedAuthoritiesConverter implements Converter<Jwt, Coll
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
if (authorities instanceof Collection) {
|
if (authorities instanceof Collection) {
|
||||||
return (Collection<String>) authorities;
|
return castAuthoritiesToCollection(authorities);
|
||||||
}
|
}
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private Collection<String> castAuthoritiesToCollection(Object authorities) {
|
||||||
|
return (Collection<String>) authorities;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user