polishing

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1928 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller 2009-09-18 14:07:19 +00:00
parent 276c5b7d7a
commit 472af43b0e
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

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.
@ -149,7 +149,7 @@ public class JndiTemplate {
if (logger.isDebugEnabled()) {
logger.debug("Looking up JNDI object with name [" + name + "]");
}
return execute(new JndiCallback() {
return execute(new JndiCallback<Object>() {
public Object doInContext(Context ctx) throws NamingException {
Object located = ctx.lookup(name);
if (located == null) {
@ -193,7 +193,7 @@ public class JndiTemplate {
if (logger.isDebugEnabled()) {
logger.debug("Binding JNDI object with name [" + name + "]");
}
execute(new JndiCallback() {
execute(new JndiCallback<Object>() {
public Object doInContext(Context ctx) throws NamingException {
ctx.bind(name, object);
return null;
@ -212,7 +212,7 @@ public class JndiTemplate {
if (logger.isDebugEnabled()) {
logger.debug("Rebinding JNDI object with name [" + name + "]");
}
execute(new JndiCallback() {
execute(new JndiCallback<Object>() {
public Object doInContext(Context ctx) throws NamingException {
ctx.rebind(name, object);
return null;
@ -229,7 +229,7 @@ public class JndiTemplate {
if (logger.isDebugEnabled()) {
logger.debug("Unbinding JNDI object with name [" + name + "]");
}
execute(new JndiCallback() {
execute(new JndiCallback<Object>() {
public Object doInContext(Context ctx) throws NamingException {
ctx.unbind(name);
return null;