Browse Source

getPropertyTypeDescriptor bug fixes

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3876 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Keith Donald 15 years ago
parent
commit
75f36d291a
  1. 5
      org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java
  2. 2
      org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java

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

@ -364,8 +364,9 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra @@ -364,8 +364,9 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException {
try {
PropertyTokenHolder tokens = getPropertyNameTokens(propertyName);
PropertyDescriptor pd = getPropertyDescriptorInternal(tokens.actualName);
BeanWrapper nestedBw = getNestedBeanWrapper(propertyName);
PropertyTokenHolder tokens = getPropertyNameTokens(getFinalPath(nestedBw, propertyName));
PropertyDescriptor pd = getPropertyDescriptorInternal(tokens.actualName);
if (pd != null) {
if (tokens.keys != null) {
if (pd.getReadMethod() != null) {

2
org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java

@ -102,8 +102,6 @@ public class TypeDescriptorTests { @@ -102,8 +102,6 @@ public class TypeDescriptorTests {
assertTrue(typeDescriptor.isArray());
assertEquals(List.class,typeDescriptor.getElementType());
assertEquals(String.class, typeDescriptor.getElementTypeDescriptor().getElementType());
// TODO asc notice that the type of the list elements is lost: typeDescriptor.getElementType() should return a TypeDescriptor
assertEquals("java.util.List[]",typeDescriptor.asString());
}

Loading…
Cancel
Save