From ba613f2e35901107d1a9009d129b6796a9553a7c Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 9 Apr 2009 22:04:08 +0000 Subject: [PATCH] allow for null --- .../org/springframework/core/convert/TypeDescriptor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 f01863014e..a0dcc15516 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 @@ -137,7 +137,8 @@ public class TypeDescriptor { * Is this type an array type? */ public boolean isArray() { - return getType().isArray(); + Class type = getType(); + return (type==null?false:type.isArray()); } /** @@ -280,7 +281,11 @@ public class TypeDescriptor { // TODO should properly handle multi dimensional arrays stringValue.append(getArrayComponentType().getName()).append("[]"); } else { - stringValue.append(getType().getName()); + Class clazz = getType(); + if (clazz==null) { + return "null"; + } + stringValue.append(clazz.getName()); if (isCollection()) { Class collectionType = getCollectionElementType(); if (collectionType!=null) {