2009-05-18 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 18 May 2009 09:14:51 +0000 (09:14 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 18 May 2009 09:14:51 +0000 (09:14 -0000)
* XmlFormatterDeserializer.cs : remove type lookup optimization
  (since .NET 3.5 introduced system types with DC) and fix
  serialization of system types (ISerializable types were not
  resolved in previous code).

svn path=/trunk/mcs/; revision=134310

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

index 4a497c8626bbfc674154fee192a9345c67a1984a..ffd081a4add02c679d52e31efb8b59c3b509a730 100755 (executable)
@@ -1,3 +1,10 @@
+2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XmlFormatterDeserializer.cs : remove type lookup optimization
+         (since .NET 3.5 introduced system types with DC) and fix
+         serialization of system types (ISerializable types were not
+         resolved in previous code).
+
 2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
 
        * SerializationMap.cs : it was only about 2.1. Fix build.
index ab2af67a7152315764d08b486fbce8b8023753e9..ac0a678241b01977810322148f97e18cb8e369ef 100644 (file)
@@ -188,16 +188,14 @@ namespace System.Runtime.Serialization
                {
                        int xlen = KnownTypeCollection.DefaultClrNamespaceBase.Length;
                        string clrns = ns.Length > xlen ?  ns.Substring (xlen) : null;
+
                        foreach (var ass in AppDomain.CurrentDomain.GetAssemblies ()) {
-                               bool sysass = ass != typeof (Type).Assembly && ass.FullName.StartsWith ("System"); // FIXME: hacky optimization
                                foreach (var t in ass.GetTypes ()) {
-                                       if (!sysass) {
-                                               var dca = t.GetCustomAttribute<DataContractAttribute> (true);
-                                               if (dca != null && dca.Name == name && dca.Namespace == ns)
-                                                       return t;
-                                               if (clrns != null && t.Name == name && t.Namespace == clrns)
-                                                       return t;
-                                       }
+                                       var dca = t.GetCustomAttribute<DataContractAttribute> (true);
+                                       if (dca != null && dca.Name == name && dca.Namespace == ns)
+                                               return t;
+                                       if (clrns != null && t.Name == name && t.Namespace == clrns)
+                                               return t;
                                }
                        }
                        throw new XmlException (String.Format ("Type not found; name: {0}, namespace: {1}", name, ns));