Skip to content

Commit 7bfc6af

Browse files
committed
Add missing havingValue="true" for *.enabled
Fix that `*.enabled=false` should not be effectively enabled.
1 parent c1a7331 commit 7bfc6af

File tree

35 files changed

+59
-42
lines changed

35 files changed

+59
-42
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/audit/AuditAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
@AutoConfiguration
4343
@ConditionalOnBean(AuditEventRepository.class)
44-
@ConditionalOnProperty(prefix = "management.auditevents", name = "enabled", matchIfMissing = true)
44+
@ConditionalOnProperty(prefix = "management.auditevents", name = "enabled", havingValue = "true", matchIfMissing = true)
4545
public class AuditAutoConfiguration {
4646

4747
@Bean

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
* @since 2.0.0
7777
*/
7878
@AutoConfiguration(after = { HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class })
79-
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", matchIfMissing = true)
79+
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", havingValue = "true",
80+
matchIfMissing = true)
8081
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
8182
@ConditionalOnCloudPlatform(CloudPlatform.CLOUD_FOUNDRY)
8283
public class ReactiveCloudFoundryActuatorAutoConfiguration {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
*/
7878
@AutoConfiguration(after = { ServletManagementContextAutoConfiguration.class, HealthEndpointAutoConfiguration.class,
7979
InfoEndpointAutoConfiguration.class })
80-
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", matchIfMissing = true)
80+
@ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", havingValue = "true",
81+
matchIfMissing = true)
8182
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
8283
@ConditionalOnClass(DispatcherServlet.class)
8384
@ConditionalOnBean(DispatcherServlet.class)

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusSimpleclientMetricsExportAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ PrometheusSimpleclientScrapeEndpoint prometheusEndpoint(CollectorRegistry collec
119119
*/
120120
@Configuration(proxyBeanMethods = false)
121121
@ConditionalOnClass(PushGateway.class)
122-
@ConditionalOnProperty(prefix = "management.prometheus.metrics.export.pushgateway", name = "enabled")
122+
@ConditionalOnProperty(prefix = "management.prometheus.metrics.export.pushgateway", name = "enabled",
123+
havingValue = "true")
123124
static class PrometheusPushGatewayConfiguration {
124125

125126
/**

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/BravePropagationConfigurations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CompositePropagationFactory propagationFactory(TracingProperties properties) {
6868
* Propagates traces and baggage.
6969
*/
7070
@Configuration(proxyBeanMethods = false)
71-
@ConditionalOnProperty(value = "management.tracing.baggage.enabled", matchIfMissing = true)
71+
@ConditionalOnProperty(value = "management.tracing.baggage.enabled", havingValue = "true", matchIfMissing = true)
7272
@EnableConfigurationProperties(TracingProperties.class)
7373
static class PropagationWithBaggage {
7474

@@ -143,7 +143,7 @@ CorrelationScopeDecorator.Builder mdcCorrelationScopeDecoratorBuilder(
143143
@Bean
144144
@Order(0)
145145
@ConditionalOnProperty(prefix = "management.tracing.baggage.correlation", name = "enabled",
146-
matchIfMissing = true)
146+
havingValue = "true", matchIfMissing = true)
147147
CorrelationScopeCustomizer correlationFieldsCorrelationScopeCustomizer() {
148148
return (builder) -> {
149149
Correlation correlationProperties = this.tracingProperties.getBaggage().getCorrelation();

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/OpenTelemetryPropagationConfigurations.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ TextMapPropagator textMapPropagator(TracingProperties properties) {
5858
* Propagates traces and baggage.
5959
*/
6060
@Configuration(proxyBeanMethods = false)
61-
@ConditionalOnProperty(prefix = "management.tracing.baggage", name = "enabled", matchIfMissing = true)
61+
@ConditionalOnProperty(prefix = "management.tracing.baggage", name = "enabled", havingValue = "true",
62+
matchIfMissing = true)
6263
@EnableConfigurationProperties(TracingProperties.class)
6364
static class PropagationWithBaggage {
6465

@@ -81,7 +82,7 @@ TextMapPropagator textMapPropagatorWithBaggage(OtelCurrentTraceContext otelCurre
8182
@Bean
8283
@ConditionalOnMissingBean
8384
@ConditionalOnProperty(prefix = "management.tracing.baggage.correlation", name = "enabled",
84-
matchIfMissing = true)
85+
havingValue = "true", matchIfMissing = true)
8586
Slf4JBaggageEventListener otelSlf4JBaggageEventListener() {
8687
return new Slf4JBaggageEventListener(this.tracingProperties.getBaggage().getCorrelation().getFields());
8788
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/exchanges/HttpExchangesAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
*/
4141
@AutoConfiguration
4242
@ConditionalOnWebApplication
43-
@ConditionalOnProperty(prefix = "management.httpexchanges.recording", name = "enabled", matchIfMissing = true)
43+
@ConditionalOnProperty(prefix = "management.httpexchanges.recording", name = "enabled", havingValue = "true",
44+
matchIfMissing = true)
4445
@ConditionalOnBean(HttpExchangeRepository.class)
4546
@EnableConfigurationProperties(HttpExchangesProperties.class)
4647
public class HttpExchangesAutoConfiguration {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public class PersistenceExceptionTranslationAutoConfiguration {
4040

4141
@Bean
4242
@ConditionalOnMissingBean
43-
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled", matchIfMissing = true)
43+
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled", havingValue = "true",
44+
matchIfMissing = true)
4445
public static PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor(
4546
Environment environment) {
4647
PersistenceExceptionTranslationPostProcessor postProcessor = new PersistenceExceptionTranslationPostProcessor();

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
HibernateJpaAutoConfiguration.class })
106106
@ConditionalOnClass(Flyway.class)
107107
@Conditional(FlywayDataSourceCondition.class)
108-
@ConditionalOnProperty(prefix = "spring.flyway", name = "enabled", matchIfMissing = true)
108+
@ConditionalOnProperty(prefix = "spring.flyway", name = "enabled", havingValue = "true", matchIfMissing = true)
109109
@Import(DatabaseInitializationDependencyConfigurer.class)
110110
@ImportRuntimeHints(FlywayAutoConfigurationRuntimeHints.class)
111111
public class FlywayAutoConfiguration {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerReactiveWebConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ freemarker.template.Configuration freeMarkerConfiguration(FreeMarkerConfig confi
5959

6060
@Bean
6161
@ConditionalOnMissingBean(name = "freeMarkerViewResolver")
62-
@ConditionalOnProperty(name = "spring.freemarker.enabled", matchIfMissing = true)
62+
@ConditionalOnProperty(name = "spring.freemarker.enabled", havingValue = "true", matchIfMissing = true)
6363
FreeMarkerViewResolver freeMarkerViewResolver() {
6464
FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
6565
resolver.setPrefix(getProperties().getPrefix());

0 commit comments

Comments
 (0)