From 428806d71f38abad2369d1644e050a812ef3fe60 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sat, 18 Jul 2026 12:37:03 -0700 Subject: [PATCH 1/2] Adapt to improvements in Nullaway 0.13.8 This commit adapts @Nullable when calling Map#remove as it correctly handles nullability. See gh-50972 Signed-off-by: Manu Sridharan --- .../boot/devtools/restart/RestartScopeInitializer.java | 2 +- .../org/springframework/boot/devtools/restart/Restarter.java | 2 +- .../boot/webmvc/test/autoconfigure/WebDriverScope.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java b/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java index f03bbc4b598d..8fc700b32da4 100644 --- a/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java +++ b/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/RestartScopeInitializer.java @@ -47,7 +47,7 @@ public Object get(String name, ObjectFactory objectFactory) { } @Override - public Object remove(String name) { + public @Nullable Object remove(String name) { return Restarter.getInstance().removeAttribute(name); } diff --git a/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java b/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java index ae205b0c2fd7..8727c0ace9e7 100644 --- a/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java +++ b/module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java @@ -450,7 +450,7 @@ public Object getOrAddAttribute(String name, final ObjectFactory objectFactor return value; } - public Object removeAttribute(String name) { + public @Nullable Object removeAttribute(String name) { return this.attributes.remove(name); } diff --git a/module/spring-boot-webmvc-test/src/main/java/org/springframework/boot/webmvc/test/autoconfigure/WebDriverScope.java b/module/spring-boot-webmvc-test/src/main/java/org/springframework/boot/webmvc/test/autoconfigure/WebDriverScope.java index cd9019369879..44714aef4c30 100644 --- a/module/spring-boot-webmvc-test/src/main/java/org/springframework/boot/webmvc/test/autoconfigure/WebDriverScope.java +++ b/module/spring-boot-webmvc-test/src/main/java/org/springframework/boot/webmvc/test/autoconfigure/WebDriverScope.java @@ -68,7 +68,7 @@ public Object get(String name, ObjectFactory objectFactory) { } @Override - public Object remove(String name) { + public @Nullable Object remove(String name) { synchronized (this.instances) { return this.instances.remove(name); } From d9ff81ff4af44b154957a5a1dfd3fea81c8bd608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 21 Jul 2026 14:48:46 +0200 Subject: [PATCH 2/2] Polish "Adapt to improvements in Nullaway 0.13.8" See gh-50972 --- .../TestcontainersLifecycleOrderWithScopeIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleOrderWithScopeIntegrationTests.java b/core/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleOrderWithScopeIntegrationTests.java index bb42ef6bf231..b826e2f2be9f 100644 --- a/core/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleOrderWithScopeIntegrationTests.java +++ b/core/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleOrderWithScopeIntegrationTests.java @@ -164,7 +164,7 @@ public Object get(String name, ObjectFactory objectFactory) { } @Override - public Object remove(String name) { + public @Nullable Object remove(String name) { synchronized (this) { Object removed = this.instances.remove(name); List destructor = this.destructors.get(name);