From: Thomas R. <tri...@us...> - 2009-03-15 18:44:49
|
Update of /cvsroot/springframework/spring/src/org/springframework/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14208/src/org/springframework/core Modified Files: Tag: branch-2-5-6-p1 GenericTypeResolver.java Log Message: fix for garbage collection issue Index: GenericTypeResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/GenericTypeResolver.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** GenericTypeResolver.java 8 May 2008 10:58:34 -0000 1.3 --- GenericTypeResolver.java 15 Mar 2009 18:44:28 -0000 1.3.2.1 *************** *** 22,25 **** --- 22,27 ---- import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; + import java.lang.ref.WeakReference; + import java.lang.ref.Reference; import java.util.Collections; import java.util.HashMap; *************** *** 143,147 **** */ static Map getTypeVariableMap(Class clazz) { ! Map typeVariableMap = (Map) typeVariableCache.get(clazz); if (typeVariableMap == null) { --- 145,150 ---- */ static Map getTypeVariableMap(Class clazz) { ! Reference ref = (Reference) typeVariableCache.get(clazz); ! Map typeVariableMap = (Map) (ref != null ? ref.get() : null); if (typeVariableMap == null) { *************** *** 175,179 **** } ! typeVariableCache.put(clazz, typeVariableMap); } --- 178,182 ---- } ! typeVariableCache.put(clazz, new WeakReference(typeVariableMap)); } |