Bug 15572. Lookup KnownTypeCollection element types in MSSimpleNamespace
authorbrendanzagaeski <brendan.zagaeski@xamarin.com>
Wed, 27 Nov 2013 04:09:00 +0000 (23:09 -0500)
committerbrendanzagaeski <brendan.zagaeski@xamarin.com>
Wed, 27 Nov 2013 04:09:00 +0000 (23:09 -0500)
This patch prevents the problem in https://bugzilla.xamarin.com/show_bug.cgi?id=15572. This change allows the DataContractSerializer to deserialize DataMembers that use an array KnownType, at least for the test case in the bug report.

mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs

index b4eae19e8d874f080a69aae7dd2fc04ebde95e07..52e5bc7bd07965c8d36f45720d84569b9d5716c9 100644 (file)
@@ -261,7 +261,7 @@ namespace System.Runtime.Serialization
                        if (name.StartsWith ("ArrayOf", StringComparison.Ordinal)) {
                                name = name.Substring (7); // strip "ArrayOf"
                                if (ns == KnownTypeCollection.MSArraysNamespace)
-                                       return GetTypeFromNamePair (name, String.Empty).MakeArrayType ();
+                                       return GetTypeFromNamePair (name, KnownTypeCollection.MSSimpleNamespace).MakeArrayType ();
                                makeArray = true;
                        }