From 75f36d291a6046062f673dc9cbec98a2b9c85852 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Thu, 6 Jan 2011 23:12:00 +0000 Subject: [PATCH] getPropertyTypeDescriptor bug fixes git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3876 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../main/java/org/springframework/beans/BeanWrapperImpl.java | 5 +++-- .../springframework/core/convert/TypeDescriptorTests.java | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java b/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java index bbf65a0216d..42e69c358fe 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java @@ -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) { diff --git a/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java b/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java index 7c7eca223e3..37d5a214d80 100644 --- a/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java +++ b/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java @@ -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()); }