mail-archives/mono-bugs/2006-February/039368.html

140 строки
5.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 77589][Nor] New - SerializationCodeGenerator
generates invalid code for jagged byte array
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077589%5D%5BNor%5D%20New%20-%20SerializationCodeGenerator%0A%09generates%20invalid%20code%20for%20jagged%20byte%20array&In-Reply-To=bug-77589%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="039367.html">
<LINK REL="Next" HREF="039369.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 77589][Nor] New - SerializationCodeGenerator
generates invalid code for jagged byte array</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077589%5D%5BNor%5D%20New%20-%20SerializationCodeGenerator%0A%09generates%20invalid%20code%20for%20jagged%20byte%20array&In-Reply-To=bug-77589%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 77589][Nor] New - SerializationCodeGenerator
generates invalid code for jagged byte array">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Sat Feb 18 06:35:19 EST 2006</I>
<P><UL>
<LI>Previous message: <A HREF="039367.html">[Mono-bugs] [Bug 77588][Nor] Changed - [PATCH]
SerializationCodeGenerator generates invalid code for Array
with no default public ctor
</A></li>
<LI>Next message: <A HREF="039369.html">[Mono-bugs] [Bug 77486][Nor] Changed - Uri.ToString() doesn't
escape '&amp;' in query
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#39368">[ date ]</a>
<a href="thread.html#39368">[ thread ]</a>
<a href="subject.html#39368">[ subject ]</a>
<a href="author.html#39368">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">gert.driesen at pandora.be.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=77589">http://bugzilla.ximian.com/show_bug.cgi?id=77589</A>
--- shadow/77589 2006-02-18 06:35:19.000000000 -0500
+++ shadow/77589.tmp.16431 2006-02-18 06:35:19.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 77589
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.XML
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">lluis at ximian.com</A>
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">gert.driesen at pandora.be</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: SerializationCodeGenerator generates invalid code for jagged byte array
+
+SerializationCodeGenerator generates invalid code for a jagged byte array
+which has been assigned an XmlAttribute with DataType &quot;base64Binary&quot;.
+
+To reproduce, compile the following code snippet:
+
+using System;
+using System.Collections;
+using System.Xml.Serialization;
+
+public class EntryPoint
+{
+ static void Main ()
+ {
+ XmlReflectionImporter importer = new XmlReflectionImporter ();
+ XmlTypeMapping map = importer.ImportTypeMapping (typeof (ArrayType));
+ XmlSerializer xs = new XmlSerializer (map);
+ xs.Serialize (Console.Out, new ArrayType ());
+ }
+}
+
+public class ArrayType
+{
+ [XmlAttribute (DataType = &quot;base64Binary&quot;)]
+ public byte[][] bin1 = new byte[][] { new byte[] { 1, 2 }, new byte[] {
+1, 2 } };
+}
+
+and run it:
+
+$ export MONO_XMLSERIALIZER_THS=0
+$ mono test.exe
+
+Actual result:
+
+Error while compiling generated serializer
+/tmp/xxxxx.cs : warning CS0642: Possible mistaken empty statement
+/tmp/xxxxx.cs : error CS1526: A new expression requires () or [] after
+type
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;
+&lt;ArrayType xmlns:xsd=&quot;<A HREF="http://www.w3.org/2001/XMLSchema&quot;">http://www.w3.org/2001/XMLSchema&quot;</A>
+xmlns:xsi=&quot;<A HREF="http://www.w3.org/2001/XMLSchema-instance&quot;">http://www.w3.org/2001/XMLSchema-instance&quot;</A> bin1=&quot;AQI= AQI=&quot; /&gt;
+
+Expected result:
+
+&lt;ArrayType xmlns:xsd=&quot;<A HREF="http://www.w3.org/2001/XMLSchema&quot;">http://www.w3.org/2001/XMLSchema&quot;</A>
+xmlns:xsi=&quot;<A HREF="http://www.w3.org/2001/XMLSchema-instance&quot;">http://www.w3.org/2001/XMLSchema-instance&quot;</A> bin1=&quot;AQI= AQI=&quot; /&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="039367.html">[Mono-bugs] [Bug 77588][Nor] Changed - [PATCH]
SerializationCodeGenerator generates invalid code for Array
with no default public ctor
</A></li>
<LI>Next message: <A HREF="039369.html">[Mono-bugs] [Bug 77486][Nor] Changed - Uri.ToString() doesn't
escape '&amp;' in query
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#39368">[ date ]</a>
<a href="thread.html#39368">[ thread ]</a>
<a href="subject.html#39368">[ subject ]</a>
<a href="author.html#39368">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>