Mark addGrantedAuthorityCollection Value Parameter Nullable
The io.spring.nullability plugin 0.0.16 upgrade tightens NullAway analysis and flags the raw Collection<?> element passed into addGrantedAuthorityCollection(Collection, Object) as possibly null, even though the method already null-checks it internally. See gh-19670 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
This commit is contained in:
+3
-1
@@ -26,6 +26,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
@@ -121,7 +123,7 @@ public class MapBasedAttributes2GrantedAuthoritiesMapper
|
||||
* to the given result collection.
|
||||
* @param value The value to convert to a GrantedAuthority Collection
|
||||
*/
|
||||
private void addGrantedAuthorityCollection(Collection<GrantedAuthority> result, Object value) {
|
||||
private void addGrantedAuthorityCollection(Collection<GrantedAuthority> result, @Nullable Object value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user