Author: spouliot
Date: 2008-02-16 19:45:37 -0500 (Sat, 16 Feb 2008)
New Revision: 95943
Modified:
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/AvoidLongMethodsRule.cs
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
Log:
2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
* AvoidLongMethodsRule.cs: Avoid NRE when processing System.Object.
Modified:
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/AvoidLongMethodsRule.cs
===================================================================
---
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/AvoidLongMethodsRule.cs
2008-02-17 00:44:25 UTC (rev 95942)
+++
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/AvoidLongMethodsRule.cs
2008-02-17 00:45:37 UTC (rev 95943)
@@ -67,8 +67,8 @@
if (method.Parameters.Count != 0)
return false;
- if (method.DeclaringType is TypeDefinition) {
- TypeDefinition type = (TypeDefinition)
method.DeclaringType;
+ TypeDefinition type = method.DeclaringType.Resolve ();
+ if ((type != null) && (type.BaseType != null)) {
if (typeMethodDictionary.ContainsKey
(type.BaseType.FullName))
return (String.Compare (method.Name,
(string) typeMethodDictionary[type.BaseType.FullName]) == 0);
}
Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
===================================================================
--- trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
2008-02-17 00:44:25 UTC (rev 95942)
+++ trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
2008-02-17 00:45:37 UTC (rev 95943)
@@ -1,3 +1,7 @@
+2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * AvoidLongMethodsRule.cs: Avoid NRE when processing System.Object.
+
2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
* AvoidCodeDuplicatedInSameClassRule.cs: Ignore rule on generated
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches