Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=77530 --- shadow/77530 2006-02-11 08:20:35.000000000 -0500 +++ shadow/77530.tmp.5920 2006-02-16 08:58:53.000000000 -0500 @@ -1,14 +1,14 @@ Bug#: 77530 Product: Mono: Class Libraries Version: 1.1 -OS: +OS: unknown OS Details: Status: NEW Resolution: -Severity: +Severity: Unknown Priority: Normal Component: Sys.XML AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: --- @@ -60,6 +60,70 @@ Let me know if its ok to commit this patch. ------- Additional Comments From [EMAIL PROTECTED] 2006-02-11 08:20 ------- Created an attachment (id=16479) Fixes and unit tests + +------- Additional Comments From [EMAIL PROTECTED] 2006-02-16 08:58 ------- +Gert, thanks for the patch. Here are some comments: + +In EnumMap.GetXmlName: +* I think the call to XmlCustomFormatter.FromEnum should be done only +when the enum is a flags enum. If it is not, shouldn't it just return +the long value? +* The cration of the names and values arrays should only be done once +and they should be stored in the enum map. + +In SerializationCodeGenerator.GenerateGetXmlEnumValue: +Same as before, the names and values arrays should not be created for +each call to the generated conversion method. +Also, looks like the old line "if (val.ToString () == \"0\") return +string.Empty;" is lost? + +In GenerateWriteObject: + +@@ -608,28 +620,27 @@ + ArrayList types = typeMap.DerivedTypes; + + WriteLine ("System.Type type = ob.GetType ();"); +- WriteLine ("if (type == typeof(" + typeMap.TypeFullName + "))"); +- WriteLine ("\t;"); +- ++ WriteLine ("if (type == typeof(" + typeMap.TypeFullName + ")) {"); ++ + for (int n=0; n<types.Count; n++) + { + XmlTypeMapping map = (XmlTypeMapping)types[n]; + +- WriteLineInd ("else if (type == typeof(" + map.TypeFullName + ")) +{ "); ++ WriteLineInd ("} else if (type == typeof(" + map.TypeFullName + +")) { "); + WriteLine (GetWriteObjectName (map) + "((" + map.TypeFullName + +")ob, element, namesp, isNullable, true, writeWrappingElem);"); + WriteLine ("return;"); + WriteLineUni ("}"); + } + +This is wrong. It's going to fail if types.Count > 0. + +Replacing +- WriteLine ("\t;"); +by ++ WriteLine ("{ }"); +looks like a better solution. + + +Which error does this fix: +@@ -2232,7 +2243,8 @@ + { + WriteLine ("Reader.ReadStartElement ();"); + WriteLine (typeMap.TypeFullName + " res = " + GenerateGetEnumValue +(typeMap, "Reader.ReadString()") + ";"); +- WriteLine ("Reader.ReadEndElement ();"); ++ WriteLineInd ("if (Reader.NodeType != XmlNodeType.None)"); ++ WriteLineUni ("Reader.ReadEndElement ();"); + WriteLine ("return res;"); + + + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
