Browse Source

polishing

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1928 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
472af43b0e
  1. 3
      org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java
  2. 7
      org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
  3. 4
      org.springframework.beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
  4. 10
      org.springframework.context/src/main/java/org/springframework/jndi/JndiTemplate.java

3
org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

@ -393,7 +393,8 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra @@ -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);
}
}

7
org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 @@ -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 @@ -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) {

4
org.springframework.beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java

@ -16,7 +16,6 @@ @@ -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; @@ -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

10
org.springframework.context/src/main/java/org/springframework/jndi/JndiTemplate.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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;

Loading…
Cancel
Save