1
0
mirror of synced 2026-09-11 03:39:49 +00:00

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:
Josh Cummings
2026-09-08 12:23:08 -06:00
parent ddcdd461e6
commit 864c082a38
@@ -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;
}