Browse Source

"conversionService" bean gets ignored if not of type ConversionService (SPR-6916)

pull/23217/head
Juergen Hoeller 15 years ago
parent
commit
9ede9fe697
  1. 3
      org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

3
org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

@ -856,7 +856,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader @@ -856,7 +856,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
*/
protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) {
// Initialize conversion service for this context.
if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME)) {
if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME) &&
beanFactory.isTypeMatch(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class)) {
beanFactory.setConversionService(
beanFactory.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class));
}

Loading…
Cancel
Save