* JsonSerializationReader.cs (DeserializeGenericCollection): in the 2.1 case we still need to convert the List<> to an array. svn path=/trunk/mcs/; revision=147835
@@ -1,3 +1,8 @@
+2009-12-08 Chris Toshok <[email protected]>
+
+ * JsonSerializationReader.cs (DeserializeGenericCollection): in
+ the 2.1 case we still need to convert the List<> to an array.
2009-12-07 Chris Toshok <[email protected]>
* JsonReaderWriterFactory.cs (CreateJsonReader): pass null for the
@@ -256,7 +256,13 @@ namespace System.Runtime.Serialization.Json
c.Add (elem);
}
#if NET_2_1
- ret = c;
+ if (collectionType.IsArray) {
+ Array array = Array.CreateInstance (elementType, c.Count);
+ c.CopyTo (array, 0);
+ ret = array;
+ }
+ else
+ ret = c;
#else
ret = collectionType.IsArray ? ((ArrayList) c).ToArray (elementType) : c;
#endif