From 1c50b1cb7ca244d941b16763b43186e52826eaa9 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sat, 29 Aug 2026 16:50:59 -0700 Subject: [PATCH] Fix new warnings from NullAway 0.14.1 Signed-off-by: Manu Sridharan See gh-51507 --- .../support/SpringApplicationJsonEnvironmentPostProcessor.java | 2 +- .../actuate/endpoint/reactive/SecurityService.java | 1 + .../autoconfigure/actuate/endpoint/servlet/SecurityService.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java b/core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java index 16747285d2b..3d134be4907 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java @@ -128,7 +128,7 @@ public class SpringApplicationJsonEnvironmentPostProcessor implements Environmen } @SuppressWarnings("unchecked") - private void extract(String name, Map result, Object value) { + private void extract(String name, Map result, @Nullable Object value) { if (value instanceof Map map) { if (CollectionUtils.isEmpty(map)) { result.put(name, value); diff --git a/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityService.java b/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityService.java index cbcc94d792d..026971dbb99 100644 --- a/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityService.java +++ b/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityService.java @@ -139,6 +139,7 @@ class SecurityService { Assert.state(keys != null, "'keys' must not be null"); for (Object key : keys) { Map tokenKey = (Map) key; + Assert.state(tokenKey != null, "'tokenKey' must not be null"); tokenKeys.put((String) tokenKey.get("kid"), (String) tokenKey.get("value")); } return tokenKeys; diff --git a/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityService.java b/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityService.java index 9078796dbef..6ec4cd96a8b 100644 --- a/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityService.java +++ b/module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityService.java @@ -118,6 +118,7 @@ class SecurityService { Assert.state(keys != null, "'keys' must not be null"); for (Object key : keys) { Map tokenKey = (Map) key; + Assert.state(tokenKey != null, "'tokenKey' must not be null"); tokenKeys.put((String) tokenKey.get("kid"), (String) tokenKey.get("value")); } return tokenKeys;