Skip to content

Commit 1f7d8dd

Browse files
committed
Merge pull request #42933 from quaff
* gh-42933: Polish "Remove unnecessary values from @ConditionalOnMissingBean" Remove unnecessary values from @ConditionalOnMissingBean Closes gh-42933
2 parents bb29625 + 00ceb37 commit 1f7d8dd

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointWebExtensionConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -118,7 +118,7 @@ JerseyAdditionalHealthEndpointPathsResourcesRegistrar jerseyAdditionalHealthEndp
118118
static class JerseyInfrastructureConfiguration {
119119

120120
@Bean
121-
@ConditionalOnMissingBean(JerseyApplicationPath.class)
121+
@ConditionalOnMissingBean
122122
JerseyApplicationPath jerseyApplicationPath(JerseyProperties properties, ResourceConfig config) {
123123
return new DefaultJerseyApplicationPath(properties.getApplicationPath(), config);
124124
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/jersey/JerseySameManagementContextConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ ResourceConfigCustomizer managementResourceConfigCustomizerAdapter(
6060
static class JerseyInfrastructureConfiguration {
6161

6262
@Bean
63-
@ConditionalOnMissingBean(JerseyApplicationPath.class)
63+
@ConditionalOnMissingBean
6464
JerseyApplicationPath jerseyApplicationPath(JerseyProperties properties, ResourceConfig config) {
6565
return new DefaultJerseyApplicationPath(properties.getApplicationPath(), config);
6666
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ protected RabbitConnectionFactoryCreator(RabbitProperties properties) {
8989
}
9090

9191
@Bean
92-
@ConditionalOnMissingBean(RabbitConnectionDetails.class)
92+
@ConditionalOnMissingBean
9393
RabbitConnectionDetails rabbitConnectionDetails() {
9494
return new PropertiesRabbitConnectionDetails(this.properties);
9595
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -149,7 +149,7 @@ protected ConfigurableConversionService getConversionService() {
149149
static class DataSourceInitializerConfiguration {
150150

151151
@Bean
152-
@ConditionalOnMissingBean(BatchDataSourceScriptDatabaseInitializer.class)
152+
@ConditionalOnMissingBean
153153
BatchDataSourceScriptDatabaseInitializer batchDataSourceInitializer(DataSource dataSource,
154154
@BatchDataSource ObjectProvider<DataSource> batchDataSource, BatchProperties properties) {
155155
return new BatchDataSourceScriptDatabaseInitializer(batchDataSource.getIfAvailable(() -> dataSource),

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected static class IntegrationComponentScanConfiguration {
251251
protected static class IntegrationJdbcConfiguration {
252252

253253
@Bean
254-
@ConditionalOnMissingBean(IntegrationDataSourceScriptDatabaseInitializer.class)
254+
@ConditionalOnMissingBean
255255
public IntegrationDataSourceScriptDatabaseInitializer integrationDataSourceInitializer(DataSource dataSource,
256256
IntegrationProperties properties) {
257257
return new IntegrationDataSourceScriptDatabaseInitializer(dataSource, properties.getJdbc());

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@
4747
public class ActiveMQAutoConfiguration {
4848

4949
@Bean
50-
@ConditionalOnMissingBean(ActiveMQConnectionDetails.class)
50+
@ConditionalOnMissingBean
5151
ActiveMQConnectionDetails activemqConnectionDetails(ActiveMQProperties properties) {
5252
return new PropertiesActiveMQConnectionDetails(properties);
5353
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ PropertiesMongoConnectionDetails mongoConnectionDetails(MongoProperties properti
5353
}
5454

5555
@Bean
56-
@ConditionalOnMissingBean(MongoClient.class)
56+
@ConditionalOnMissingBean
5757
public MongoClient mongo(ObjectProvider<MongoClientSettingsBuilderCustomizer> builderCustomizers,
5858
MongoClientSettings settings) {
5959
return new MongoClientFactory(builderCustomizers.orderedStream().toList()).createMongoClient(settings);

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -132,7 +132,7 @@ private PlatformTransactionManager getTransactionManager(
132132
}
133133

134134
@Bean
135-
@ConditionalOnMissingBean(QuartzDataSourceScriptDatabaseInitializer.class)
135+
@ConditionalOnMissingBean
136136
@Conditional(OnQuartzDatasourceInitializationCondition.class)
137137
public QuartzDataSourceScriptDatabaseInitializer quartzDataSourceScriptDatabaseInitializer(
138138
DataSource dataSource, @QuartzDataSource ObjectProvider<DataSource> quartzDataSource,

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/JdbcSessionConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@
5656
class JdbcSessionConfiguration {
5757

5858
@Bean
59-
@ConditionalOnMissingBean(JdbcSessionDataSourceScriptDatabaseInitializer.class)
59+
@ConditionalOnMissingBean
6060
@Conditional(OnJdbcSessionDatasourceInitializationCondition.class)
6161
JdbcSessionDataSourceScriptDatabaseInitializer jdbcSessionDataSourceScriptDatabaseInitializer(
6262
@SpringSessionDataSource ObjectProvider<DataSource> sessionDataSource,

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public class ClientHttpConnectorAutoConfiguration {
5252

5353
@Bean
5454
@Lazy
55-
@ConditionalOnMissingBean(ClientHttpConnector.class)
55+
@ConditionalOnMissingBean
5656
ClientHttpConnector webClientHttpConnector(ClientHttpConnectorFactory<?> clientHttpConnectorFactory) {
5757
return clientHttpConnectorFactory.createClientHttpConnector();
5858
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ public MultipartAutoConfiguration(MultipartProperties multipartProperties) {
6363
}
6464

6565
@Bean
66-
@ConditionalOnMissingBean(MultipartConfigElement.class)
66+
@ConditionalOnMissingBean
6767
public MultipartConfigElement multipartConfigElement() {
6868
return this.multipartProperties.createMultipartConfig();
6969
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBeanTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -495,7 +495,7 @@ static class FactoryBeanXmlConfiguration {
495495
static class ConditionalOnFactoryBean {
496496

497497
@Bean
498-
@ConditionalOnMissingBean(ExampleBean.class)
498+
@ConditionalOnMissingBean
499499
ExampleBean createExampleBean() {
500500
return new ExampleBean("direct");
501501
}

0 commit comments

Comments
 (0)