From: Juergen H. <jho...@us...> - 2006-04-20 19:01:05
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4348/src/org/springframework/beans Modified Files: PropertyTypeConverter.java Log Message: fall back to approximate collection/map type if we cannot reinstantiate given collection/map Index: PropertyTypeConverter.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/PropertyTypeConverter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PropertyTypeConverter.java 6 Apr 2006 13:18:31 -0000 1.8 --- PropertyTypeConverter.java 20 Apr 2006 19:00:59 -0000 1.9 *************** *** 29,32 **** --- 29,33 ---- import org.apache.commons.logging.LogFactory; + import org.springframework.core.CollectionFactory; import org.springframework.core.GenericsHelper; import org.springframework.core.JdkVersion; *************** *** 295,299 **** elementType = GenericsHelper.getCollectionParameterType(methodParam); } ! Collection convertedCopy = (Collection) BeanUtils.instantiateClass(original.getClass()); boolean actuallyConverted = false; int i = 0; --- 296,301 ---- elementType = GenericsHelper.getCollectionParameterType(methodParam); } ! Collection convertedCopy = ! CollectionFactory.createApproximateCollection(original.getClass(), original.size()); boolean actuallyConverted = false; int i = 0; *************** *** 315,319 **** valueType = GenericsHelper.getMapValueParameterType(methodParam); } ! Map convertedCopy = (Map) BeanUtils.instantiateClass(original.getClass()); boolean actuallyConverted = false; for (Iterator it = original.entrySet().iterator(); it.hasNext();) { --- 317,321 ---- valueType = GenericsHelper.getMapValueParameterType(methodParam); } ! Map convertedCopy = CollectionFactory.createApproximateMap(original.getClass(), original.size()); boolean actuallyConverted = false; for (Iterator it = original.entrySet().iterator(); it.hasNext();) { |