2008-01-24 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 24 Jan 2008 03:55:40 +0000 (03:55 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 24 Jan 2008 03:55:40 +0000 (03:55 -0000)
* TypeData.cs : fixed setter which did not actually see the argument.
* XmlTypeMapElementInfo.cs : some cosmetic fixes for gendarme-
  reported issues.

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

mcs/class/System.XML/System.Xml.Serialization/ChangeLog
mcs/class/System.XML/System.Xml.Serialization/TypeData.cs
mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapElementInfo.cs

index 7ff4e8c3659a0ac6a7a5737781b0a519dff4393e..bf2f967697bc8153f2b31534fd029d8a648b958d 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * TypeData.cs : fixed setter which did not actually see the argument.
+       * XmlTypeMapElementInfo.cs : some cosmetic fixes for gendarme-
+         reported issues.
+
 2007-11-09  Atsushi Enomoto  <atsushi@ximian.com>
 
        * XmlTypeMapping.cs : to get schema provider method, check base
index 651e0bc1ff7a4f9ac56f06b9ad8e7f0f0bf71be7..bd6afd91c6fffbe948481524a17be745f4a135c6 100644 (file)
@@ -247,7 +247,7 @@ namespace System.Xml.Serialization
 
                        set
                        {
-                               nullableOverride = true;
+                               nullableOverride = value;
                        }
                }
 
index 2d314c561671190477d4f06de8d8ce714c39032b..1d354e4bd30c69c6743baf64602d3083d461eea6 100644 (file)
@@ -153,17 +153,27 @@ namespace System.Xml.Serialization
                public bool IsTextElement
                {
                        get { return ElementName == "<text>"; }
-                       set { ElementName = "<text>"; Namespace = string.Empty; }
+                       set {
+                               if (!value)
+                                       throw new Exception ("INTERNAL ERROR; someone wrote unexpected code in sys.xml");
+                               ElementName = "<text>"; Namespace = string.Empty;
+                       }
                }
 
                public bool IsUnnamedAnyElement
                {
                        get { return ElementName == string.Empty; }
-                       set { ElementName = string.Empty; Namespace = string.Empty; }
+                       set {
+                               if (!value)
+                                       throw new Exception ("INTERNAL ERROR; someone wrote unexpected code in sys.xml");
+                               ElementName = string.Empty; Namespace = string.Empty;
+                       }
                }
 
                public override bool Equals (object other)
                {
+                       if (other == null)
+                               return false;
                        XmlTypeMapElementInfo oinfo = (XmlTypeMapElementInfo)other;
                        if (_elementName != oinfo._elementName) return false;
                        if (_type.XmlType != oinfo._type.XmlType) return false;