From 9ede9fe697ffdf6878519d32b20eb15079c14ecd Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 4 Mar 2010 11:27:09 +0000 Subject: [PATCH] "conversionService" bean gets ignored if not of type ConversionService (SPR-6916) --- .../context/support/AbstractApplicationContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java index cea130a762..b1ea997b40 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java @@ -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)); }