|
From: Les A. H. <le...@ha...> - 2004-05-04 14:45:35
|
Quoting Dmitriy Kopylenko <dko...@ru...>: > I'm just wondering, would the use of WeakHashMap in > CachedIntrospectionResults help? I'm curious about CachedIntrospectionResults for another reason... What is the minimum JDK supported by Spring? If its JDK 1.4, I would argue that CachedIntrospectionResults is an unnecessary class (and infact incurs additional runtime memory overhead). JDK 1.4 already caches its bean introspection results, including method and property descriptors, and it does so using WeakHashMaps. So when you do a lookup for a bean, it returns the previously cached info (otherwise it does the introspection and then caches it). CachedIntrospectionResults more or less duplicates what the 1.4 java.beans.Introspector already does. If the minimum JDK supported by Spring is < 1.4, I can understand keeping the class, otherwise, wouldn't it be better to deprecate it? If so, it would be an easy fix, since CachedIntrospectionResults is only used in o.s.beans.BeanWrapperImpl in two places to retrieve PropertyDescriptors. Any thoughts? Les |