Преглед изворни кода

When finding SerializationMap for resolved type, use type as the key rather than name.

Make the fixed WCF test show more specific failure details.
Atsushi Eno пре 15 година
родитељ
комит
a16debc2c7

+ 1 - 1
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs

@@ -177,7 +177,7 @@ namespace System.Runtime.Serialization
 
 		object DeserializeByMap (QName name, Type type, XmlReader reader)
 		{
-			SerializationMap map = types.FindUserMap (type); // use type rather than name as the type could be a "resolved" one.
+			SerializationMap map = resolved_qnames.ContainsKey (name) ? types.FindUserMap (type) : types.FindUserMap (name); // use type when the name is "resolved" one. Otherwise use name (there are cases that type cannot be resolved by type).
 			if (map == null && (name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) ||
 			    name.Namespace == KnownTypeCollection.MSArraysNamespace ||
 			    name.Namespace.StartsWith (KnownTypeCollection.DefaultClrNamespaceBase, StringComparison.Ordinal))) {

+ 1 - 1
mcs/class/System.ServiceModel/Test/FeatureBased/Features.Serialization/KnownTypeTest.cs

@@ -22,7 +22,7 @@ namespace MonoTests.Features.Serialization
 
 			Point2D r = Client.Move (p1, p2);
 			Assert.IsNotNull (r, "#1");
-			Assert.IsTrue (r is AdvPoint2D, "#2");
+			Assert.AreEqual (typeof (AdvPoint2D), r.GetType (), "#2");
 			Assert.AreEqual (((AdvPoint2D) r).ZeroDistance, 5, "#3");
 
 		}