polishing

This commit is contained in:
Juergen Hoeller
2009-09-18 14:07:19 +00:00
parent 89216a4b9a
commit 99753f0d1c
4 changed files with 13 additions and 11 deletions

View File

@@ -393,7 +393,8 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
}
catch (IllegalArgumentException ex) {
throw new TypeMismatchException(value, requiredType, ex);
} catch (IllegalStateException ex) {
}
catch (IllegalStateException ex) {
throw new ConversionNotSupportedException(value, requiredType, ex);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import org.springframework.beans.FatalBeanException;
import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.core.Ordered;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
/**
@@ -146,6 +147,7 @@ public class CustomEditorConfigurer implements BeanFactoryPostProcessor, BeanCla
}
@SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.propertyEditorRegistrars != null) {
for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) {
@@ -162,7 +164,8 @@ public class CustomEditorConfigurer implements BeanFactoryPostProcessor, BeanCla
try {
requiredType = ClassUtils.forName(key, this.beanClassLoader);
Class editorClass = ClassUtils.forName(value, this.beanClassLoader);
beanFactory.registerCustomEditor(requiredType, editorClass);
Assert.isAssignable(PropertyEditor.class, editorClass);
beanFactory.registerCustomEditor(requiredType, (Class<? extends PropertyEditor>) editorClass);
}
catch (ClassNotFoundException ex) {
if (this.ignoreUnresolvableEditors) {

View File

@@ -16,7 +16,6 @@
package org.springframework.beans.factory.config;
import java.util.HashSet;
import java.util.Properties;
import org.springframework.beans.BeansException;
@@ -24,11 +23,10 @@ import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.Constants;
import org.springframework.util.StringValueResolver;
import org.springframework.util.PropertyPlaceholderHelper;
import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver;
import org.springframework.util.StringValueResolver;
/**
* A property resource configurer that resolves placeholders in bean property values of