From 9824f25998fa13cb11caec0c660ab2f09c5d47af Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 29 Jun 2026 09:12:16 +0800 Subject: [PATCH 1/2] Remove unnecessary `@Nullable`s from local array variable declarations See gh-50881 Signed-off-by: Yanming Zhou --- .../boot/context/properties/bind/ValueObjectBinder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ValueObjectBinder.java b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ValueObjectBinder.java index bdaffd389585..8f2337ace58f 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ValueObjectBinder.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ValueObjectBinder.java @@ -333,7 +333,7 @@ List getConstructorParameters() { @SuppressWarnings("unchecked") static @Nullable ValueObject get(Constructor bindConstructor, ResolvableType type, ParameterNameDiscoverer parameterNameDiscoverer) { - @Nullable String @Nullable [] names = parameterNameDiscoverer.getParameterNames(bindConstructor); + @Nullable String[] names = parameterNameDiscoverer.getParameterNames(bindConstructor); if (names == null) { return null; } @@ -422,7 +422,7 @@ public String[] getParameterNames(Method method) { @Override public @Nullable String @Nullable [] getParameterNames(Constructor constructor) { - @Nullable String @Nullable [] names = this.delegate.getParameterNames(constructor); + @Nullable String[] names = this.delegate.getParameterNames(constructor); if (names != null) { return names; } From 81aa1367f51a2753821fc9ce8de5f850b9352d42 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 29 Jun 2026 10:29:03 +0100 Subject: [PATCH 2/2] Polish "Remove unnecessary `@Nullable`s from local array variable declarations" See gh-50881 Signed-off-by: Andy Wilkinson --- .../boot/actuate/context/properties/Jackson2BeanSerializer.java | 2 +- .../boot/actuate/context/properties/JacksonBeanSerializer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/Jackson2BeanSerializer.java b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/Jackson2BeanSerializer.java index 320010bf219f..8aaf33981f7c 100644 --- a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/Jackson2BeanSerializer.java +++ b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/Jackson2BeanSerializer.java @@ -222,7 +222,7 @@ private boolean isCandidate(BeanDescription beanDesc, BeanPropertyWriter writer, @Nullable Constructor constructor) { if (constructor != null) { Parameter[] parameters = constructor.getParameters(); - @Nullable String @Nullable [] names = parameterNameDiscoverer.getParameterNames(constructor); + @Nullable String[] names = parameterNameDiscoverer.getParameterNames(constructor); if (names == null) { names = new String[parameters.length]; } diff --git a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/JacksonBeanSerializer.java b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/JacksonBeanSerializer.java index 9c1f6e9032b2..b02506d3430e 100644 --- a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/JacksonBeanSerializer.java +++ b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/JacksonBeanSerializer.java @@ -213,7 +213,7 @@ private boolean isCandidate(BeanDescription.Supplier beanDesc, BeanPropertyWrite @Nullable Constructor constructor) { if (constructor != null) { Parameter[] parameters = constructor.getParameters(); - @Nullable String @Nullable [] names = parameterNameDiscoverer.getParameterNames(constructor); + @Nullable String[] names = parameterNameDiscoverer.getParameterNames(constructor); if (names == null) { names = new String[parameters.length]; }