From 8e18a3fd7bda944ea93f20b4f2a01f8319095e36 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 4 Aug 2025 13:32:39 +0200 Subject: [PATCH] Add nullability annotations to module/spring-boot-netty See gh-46587 --- .../boot/netty/autoconfigure/NettyProperties.java | 8 +++++--- .../boot/netty/autoconfigure/package-info.java | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/NettyProperties.java b/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/NettyProperties.java index 1bafaa00489..9e6ce177ec1 100644 --- a/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/NettyProperties.java +++ b/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/NettyProperties.java @@ -16,6 +16,8 @@ package org.springframework.boot.netty.autoconfigure; +import org.jspecify.annotations.Nullable; + import org.springframework.boot.context.properties.ConfigurationProperties; /** @@ -34,13 +36,13 @@ public class NettyProperties { * 'ResourceLeakDetector.setLevel' or the 'io.netty.leakDetection.level' system * property, default to 'simple'. */ - private LeakDetection leakDetection; + private @Nullable LeakDetection leakDetection; - public LeakDetection getLeakDetection() { + public @Nullable LeakDetection getLeakDetection() { return this.leakDetection; } - public void setLeakDetection(LeakDetection leakDetection) { + public void setLeakDetection(@Nullable LeakDetection leakDetection) { this.leakDetection = leakDetection; } diff --git a/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/package-info.java b/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/package-info.java index ee697617198..a5a1a06f20e 100644 --- a/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/package-info.java +++ b/module/spring-boot-netty/src/main/java/org/springframework/boot/netty/autoconfigure/package-info.java @@ -17,4 +17,7 @@ /** * Auto-configuration for the Netty library. */ +@NullMarked package org.springframework.boot.netty.autoconfigure; + +import org.jspecify.annotations.NullMarked;