From 864c082a38185d50ba0bb56cdd21e9baa31cdeac Mon Sep 17 00:00:00 2001 From: Josh Cummings <3627351+jzheaux@users.noreply.github.com> Date: Tue, 8 Sep 2026 12:23:08 -0600 Subject: [PATCH] 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> --- .../mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java b/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java index 74dc86e95a..c970a4159c 100755 --- a/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java +++ b/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java @@ -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 result, Object value) { + private void addGrantedAuthorityCollection(Collection result, @Nullable Object value) { if (value == null) { return; }