Browse Source

Adds static to ConfigurationPropertiesBeans bean.

This avoids a bean post processor warning.

Fixes gh-657
pull/713/head
Spencer Gibb 5 years ago
parent
commit
6c9bcb9f38
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 5
      spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.java

5
spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.java

@ -48,12 +48,13 @@ public class ConfigurationPropertiesRebinderAutoConfiguration @@ -48,12 +48,13 @@ public class ConfigurationPropertiesRebinderAutoConfiguration
@Bean
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
public ConfigurationPropertiesBeans configurationPropertiesBeans() {
public static ConfigurationPropertiesBeans configurationPropertiesBeans(
ApplicationContext context) {
// Since this is a BeanPostProcessor we have to be super careful not to
// cause a cascade of bean instantiation. Knowing the *name* of the beans we
// need is super optimal, but a little brittle (unfortunately we have no
// choice).
ConfigurationBeanFactoryMetadata metaData = this.context.getBean(
ConfigurationBeanFactoryMetadata metaData = context.getBean(
ConfigurationBeanFactoryMetadata.BEAN_NAME,
ConfigurationBeanFactoryMetadata.class);
ConfigurationPropertiesBeans beans = new ConfigurationPropertiesBeans();

Loading…
Cancel
Save