From 7fb19d658b62b54bf2886325589b9b0703efc9d9 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Tue, 15 Dec 2009 19:55:10 +0000 Subject: [PATCH] primitive desc caching --- .../core/convert/TypeDescriptor.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 7cffa308c3..88036835eb 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,15 +43,31 @@ public class TypeDescriptor { private static final Map, TypeDescriptor> typeDescriptorCache = new HashMap, TypeDescriptor>(); static { - typeDescriptorCache.put(String.class, new TypeDescriptor(String.class)); + typeDescriptorCache.put(byte.class, new TypeDescriptor(byte.class)); typeDescriptorCache.put(Byte.class, new TypeDescriptor(Byte.class)); + + typeDescriptorCache.put(char.class, new TypeDescriptor(char.class)); typeDescriptorCache.put(Character.class, new TypeDescriptor(Character.class)); + + typeDescriptorCache.put(boolean.class, new TypeDescriptor(boolean.class)); typeDescriptorCache.put(Boolean.class, new TypeDescriptor(Boolean.class)); + + typeDescriptorCache.put(short.class, new TypeDescriptor(short.class)); typeDescriptorCache.put(Short.class, new TypeDescriptor(Short.class)); + + typeDescriptorCache.put(int.class, new TypeDescriptor(int.class)); typeDescriptorCache.put(Integer.class, new TypeDescriptor(Integer.class)); + + typeDescriptorCache.put(long.class, new TypeDescriptor(long.class)); typeDescriptorCache.put(Long.class, new TypeDescriptor(Long.class)); + + typeDescriptorCache.put(float.class, new TypeDescriptor(float.class)); typeDescriptorCache.put(Float.class, new TypeDescriptor(Float.class)); + + typeDescriptorCache.put(double.class, new TypeDescriptor(double.class)); typeDescriptorCache.put(Double.class, new TypeDescriptor(Double.class)); + + typeDescriptorCache.put(String.class, new TypeDescriptor(String.class)); } private Object value;