Avoid registering ConfigurationPropertiesBindingPostProcessor twice

pull/103/head
Dave Syer 11 years ago
parent e4d594cce5
commit 217ec5d564

@ -38,9 +38,11 @@ public class ConfigurationPropertiesBindingPostProcessorRegistrar implements
@Override @Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
BeanDefinitionRegistry registry) { BeanDefinitionRegistry registry) {
BeanDefinition beanDefinition = new RootBeanDefinition( if (!registry.containsBeanDefinition(BINDER_BEAN_NAME)) {
ConfigurationPropertiesBindingPostProcessor.class); BeanDefinition beanDefinition = new RootBeanDefinition(
registry.registerBeanDefinition(BINDER_BEAN_NAME, beanDefinition); ConfigurationPropertiesBindingPostProcessor.class);
registry.registerBeanDefinition(BINDER_BEAN_NAME, beanDefinition);
}
} }
} }

Loading…
Cancel
Save