[sgen] Untag the vtable during concurrent mark
[mono.git] / mcs / class / System.XML / System.Xml.Serialization / XmlReflectionImporter.cs
index 14afa1d06100f5d73ee2af22500072da483960bd..0c4e131b87d993693f86e80fab46b45468e4464a 100644 (file)
@@ -109,10 +109,8 @@ namespace System.Xml.Serialization {
                        return ImportMembersMapping (elementName, ns, members, hasWrapperElement, true);
                }
 
-#if NET_2_0
                [MonoTODO]
                public
-#endif
                XmlMembersMapping ImportMembersMapping (string elementName, 
                        string ns, 
                        XmlReflectionMember[] members, 
@@ -122,10 +120,8 @@ namespace System.Xml.Serialization {
                        return ImportMembersMapping (elementName, ns, members, hasWrapperElement, rpc, true);
                }
 
-#if NET_2_0
                [MonoTODO]
                public
-#endif
                XmlMembersMapping ImportMembersMapping (string elementName, 
                        string ns, 
                        XmlReflectionMember[] members, 
@@ -136,10 +132,8 @@ namespace System.Xml.Serialization {
                        return ImportMembersMapping (elementName, ns, members, hasWrapperElement, rpc, openModel, XmlMappingAccess.Read | XmlMappingAccess.Write);
                }
 
-#if NET_2_0
                [MonoTODO] // FIXME: handle writeAccessors, validate, and mapping access
                public
-#endif
                XmlMembersMapping ImportMembersMapping (string elementName, 
                        string ns, 
                        XmlReflectionMember[] members, 
@@ -163,7 +157,7 @@ namespace System.Xml.Serialization {
                        mps.RelatedMaps = relatedMaps;
                        mps.Format = SerializationFormat.Literal;
                        Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
-#if !NET_2_1
+#if !MOBILE
                        mps.Source = new MembersSerializationSource (elementName, hasWrapperElement, members, false, true, ns, extraTypes);
                        if (allowPrivateTypes) mps.Source.CanBeGenerated = false;
 #endif
@@ -227,14 +221,12 @@ namespace System.Xml.Serialization {
                                        default: throw new NotSupportedException ("Type " + typeData.Type.FullName + " not supported for XML stialization");
                                }
 
-#if NET_2_0
                                // bug #372780
                                map.SetKey (typeData.Type.ToString ());
-#endif
                                map.RelatedMaps = relatedMaps;
                                map.Format = SerializationFormat.Literal;
                                Type[] extraTypes = includedTypes != null ? (Type[]) includedTypes.ToArray (typeof (Type)) : null;
-#if !NET_2_1
+#if !MOBILE
                                map.Source = new XmlTypeSerializationSource (typeData.Type, root, attributeOverrides, defaultNamespace, extraTypes);
                                if (allowPrivateTypes) map.Source.CanBeGenerated = false;
 #endif
@@ -516,7 +508,7 @@ namespace System.Xml.Serialization {
                                elem.Form = att.Form;
                                if (att.Form == XmlSchemaForm.Unqualified)
                                        elem.Namespace = string.Empty;
-                               elem.IsNullable = att.IsNullable && CanBeNull (elem.TypeData);
+                               elem.IsNullable = (!att.IsNullableSpecified || att.IsNullable) && CanBeNull (elem.TypeData);
                                elem.NestingLevel = att.NestingLevel;
 
                                if (isMultiArray) {
@@ -1094,10 +1086,6 @@ namespace System.Xml.Serialization {
                
                bool CanBeNull (TypeData type)
                {
-#if !NET_2_0   // idiotic compatibility
-                       if (type.Type == typeof (XmlQualifiedName))
-                               return false;
-#endif
                        return !type.Type.IsValueType || type.IsNullable;
                }