Author: atsushi
Date: 2007-02-19 08:56:15 -0500 (Mon, 19 Feb 2007)
New Revision: 73117

Modified:
   trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
   trunk/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs
   trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
   
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs
Log:
2007-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * XmlReflectionImporter.cs : CanBeNull() should return true when the
          argument is generic nullable value type.

        * XmlReflectionImporterTests.cs : added test for nullable int import.



Modified: trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2007-02-19 13:37:43 UTC (rev 73116)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2007-02-19 13:56:15 UTC (rev 73117)
@@ -1,5 +1,10 @@
 2007-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * XmlReflectionImporter.cs : CanBeNull() should return true when the
+         argument is generic nullable value type.
+
+2007-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * TypeData.cs, MapCodeGenerator.cs, XmlMemberMapping.cs,
          TypeTranslator.cs : removed IsGenericNullable and added
          set_IsNullable so that it could be simpler.

Modified: 
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs
===================================================================
--- 
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs    
    2007-02-19 13:37:43 UTC (rev 73116)
+++ 
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs    
    2007-02-19 13:56:15 UTC (rev 73117)
@@ -1079,7 +1079,7 @@
                        if (type.Type == typeof (XmlQualifiedName))
                                return false;
 #endif
-                       return !type.Type.IsValueType;
+                       return !type.Type.IsValueType || type.IsNullable;
                }
                
                public void IncludeType (Type type)

Modified: trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2007-02-19 13:37:43 UTC (rev 73116)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2007-02-19 13:56:15 UTC (rev 73117)
@@ -1,3 +1,7 @@
+2007-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * XmlReflectionImporterTests.cs : added test for nullable int import.
+
 2007-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * XmlSerializerTests.cs : added HasFieldSpecifiedButIrrelevant().

Modified: 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs
===================================================================
--- 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs
      2007-02-19 13:37:43 UTC (rev 73116)
+++ 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs
      2007-02-19 13:56:15 UTC (rev 73117)
@@ -1539,7 +1539,23 @@
                }
 
 #if NET_2_0
+
                [Test]
+               public void ImportNullableInt ()
+               {
+                       XmlReflectionImporter imp = new XmlReflectionImporter 
();
+                       XmlTypeMapping map = imp.ImportTypeMapping (typeof 
(int?));
+                       XmlSchemas schemas = new XmlSchemas ();
+                       XmlSchemaExporter exp = new XmlSchemaExporter (schemas);
+                       exp.ExportTypeMapping (map);
+                       XmlSchema schema = schemas [0];
+                       XmlSchemaElement el = schema.Items [0] as 
XmlSchemaElement;
+                       Assert.AreEqual ("int", el.Name, "#1");
+                       Assert.AreEqual (new XmlQualifiedName ("int", 
XmlSchema.Namespace), el.SchemaTypeName, "#2");
+                       Assert.AreEqual (true, el.IsNillable, "#3");
+               }
+
+               [Test]
                public void ImportNullableContainer ()
                {
                        new XmlSerializer (typeof (NullableContainer));

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to