From 9fa2883ef7b56297e1c29d3b324709def641906f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 26 Jul 2010 20:55:14 +0000 Subject: [PATCH] turned TypeDescriptor.UNKNOWN into an internal detail (SPR-7349) git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3507 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../org/springframework/core/convert/TypeDescriptor.java | 2 +- .../core/convert/support/PropertyTypeDescriptor.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index a7d27ee005c..096edb05009 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -43,7 +43,7 @@ public class TypeDescriptor { public static final TypeDescriptor NULL = new TypeDescriptor(); /** Constant defining a TypeDescriptor for 'unknown type' */ - public static final TypeDescriptor UNKNOWN = new TypeDescriptor(Object.class); + private static final TypeDescriptor UNKNOWN = new TypeDescriptor(Object.class); private static final Map, TypeDescriptor> typeDescriptorCache = new HashMap, TypeDescriptor>(); diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/support/PropertyTypeDescriptor.java b/org.springframework.core/src/main/java/org/springframework/core/convert/support/PropertyTypeDescriptor.java index b2813a7fb15..d6b6b07ceaf 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/support/PropertyTypeDescriptor.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/support/PropertyTypeDescriptor.java @@ -118,11 +118,11 @@ public class PropertyTypeDescriptor extends TypeDescriptor { } public TypeDescriptor forElementType(Class elementType) { - if (elementType == null) { - return TypeDescriptor.UNKNOWN; + if (elementType != null) { + return new PropertyTypeDescriptor(this.propertyDescriptor, getMethodParameter(), elementType); } else { - return new PropertyTypeDescriptor(this.propertyDescriptor, getMethodParameter(), elementType); + return super.forElementType(null); } }