2007-02-20 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 20 Feb 2007 21:14:32 +0000 (21:14 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 20 Feb 2007 21:14:32 +0000 (21:14 -0000)
* mono-api-diff.cs : Report difference between parameter attributes.

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

mcs/tools/corcompare/ChangeLog
mcs/tools/corcompare/mono-api-diff.cs

index aef2092f4102f36f3afa5c892e872e84861d7af9..d5d634999b0149513865000501b8fc1aeef532a4 100644 (file)
@@ -1,3 +1,7 @@
+2007-02-20  Marek Safar <marek.safar@gmail.com>
+
+       * mono-api-diff.cs : Report difference between parameter attributes.
+
 2006-01-26  Atsushi Enomoto  <atsushi@ximian.com>
 
        * mono-api-info.cs
index b4983c0590e33a298ff653fd44fbced513ee4d9a..ab3346bc245b37116993373642ba7f31108554fd 100644 (file)
@@ -3,7 +3,8 @@
 //                   produces a file suitable to build class status pages.
 //
 // Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//     Gonzalo Paniagua Javier (gonzalo@ximian.com)\r
+//     Marek Safar                             (marek.safar@gmail.com)
 //
 // (C) 2003 Novell, Inc (http://www.novell.com)
 //
@@ -920,6 +921,7 @@ namespace Mono.AssemblyCompare
                bool isUnsafe;
                bool isOptional;
                string defaultValue;
+               XMLAttributes attributes;
 
                public override void LoadData (XmlNode node)
                {
@@ -939,7 +941,17 @@ namespace Mono.AssemblyCompare
                        if (node.Attributes["optional"] != null)
                                isOptional = bool.Parse (node.Attributes["optional"].Value);
                        if (node.Attributes["defaultValue"] != null)
-                               defaultValue = node.Attributes["defaultValue"].Value;
+                               defaultValue = node.Attributes["defaultValue"].Value;\r
+\r
+                       XmlNode child = node.FirstChild;\r
+                       if (child == null)\r
+                               return;\r
+
+                       if (child.Name == "attributes") {
+                               attributes = new XMLAttributes ();
+                               attributes.LoadData (child);
+                               child = child.NextSibling;
+                       }
                }
 
                public override void CompareTo (XmlDocument doc, XmlNode parent, object other)
@@ -965,6 +977,22 @@ namespace Mono.AssemblyCompare
 
                        if (defaultValue != oparm.defaultValue)
                                AddWarning (parent, "Parameter default value wrong: {0} != {1}", (defaultValue == null) ? "(no default value)" : defaultValue, (oparm.defaultValue == null) ? "(no default value)" : oparm.defaultValue);
+
+                       if (attributes != null || oparm.attributes != null) {
+                               if (attributes == null)
+                                       attributes = new XMLAttributes ();\r
+\r
+                               attributes.CompareTo (doc, parent, oparm.attributes);
+                               counters.AddPartialToPartial (attributes.Counters);
+                               if (oparm.attributes != null && oparm.attributes.IsTodo) {
+                                       counters.Todo++;
+                                       counters.TodoTotal++;
+                                       counters.ErrorTotal++;
+                                       AddAttribute (parent, "error", "todo");\r
+                                       if (oparm.attributes.Comment != null)\r
+                                               AddAttribute (parent, "comment", oparm.attributes.Comment);
+                               }
+                       }
                }
 
                public string Name {