From fa9c1f0c41158bca4402d3bd7baea3939e44422d Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 17 Mar 2025 10:55:36 +0800 Subject: [PATCH 1/2] Polish usage of @ConfigurationProperties See gh-44725 Signed-off-by: Yanming Zhou --- .../autoconfigure/web/server/ManagementServerProperties.java | 2 +- .../groovy/template/GroovyTemplateProperties.java | 4 ++-- .../boot/autoconfigure/web/ServerProperties.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index e476398f541..28a0ecaddc8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -33,7 +33,7 @@ import org.springframework.util.StringUtils; * @since 2.0.0 * @see ServerProperties */ -@ConfigurationProperties(prefix = "management.server", ignoreUnknownFields = true) +@ConfigurationProperties("management.server") public class ManagementServerProperties { /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java index ba548bad857..85c694d3c91 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Marten Deinum * @since 1.1.0 */ -@ConfigurationProperties(prefix = "spring.groovy.template", ignoreUnknownFields = true) +@ConfigurationProperties("spring.groovy.template") public class GroovyTemplateProperties extends AbstractTemplateViewResolverProperties { public static final String DEFAULT_RESOURCE_LOADER_PATH = "classpath:/templates/"; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index f1486c636a4..7a2ebf1e079 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -75,7 +75,7 @@ import org.springframework.util.unit.DataSize; * @author Lasse Wulff * @since 1.0.0 */ -@ConfigurationProperties(prefix = "server", ignoreUnknownFields = true) +@ConfigurationProperties("server") public class ServerProperties { /** From 6ec6132cc2fda6349da12ffe2c5292fab68783bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Mon, 17 Mar 2025 08:52:25 +0100 Subject: [PATCH 2/2] Update copyright year of changed files See gh-44725 --- .../autoconfigure/web/server/ManagementServerProperties.java | 2 +- .../boot/autoconfigure/web/ServerProperties.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index 28a0ecaddc8..297a885bd6b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 7a2ebf1e079..75b742e597a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.