Author: spouliot
Date: 2008-02-17 15:16:57 -0500 (Sun, 17 Feb 2008)
New Revision: 95997
Modified:
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/Expression.cs
Log:
2008-02-17 Sebastien Pouliot <[EMAIL PROTECTED]>
* Expression.cs: Avoid double-cast and don't throw an exception here
(not a good place). We need a rule for the later behaviour.
Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
===================================================================
--- trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
2008-02-17 20:12:19 UTC (rev 95996)
+++ trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/ChangeLog
2008-02-17 20:16:57 UTC (rev 95997)
@@ -1,3 +1,8 @@
+2008-02-17 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * Expression.cs: Avoid double-cast and don't throw an exception here
+ (not a good place). We need a rule for the later behaviour.
+
2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
* AvoidLongMethodsRule.cs: Avoid NRE when processing System.Object.
Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/Expression.cs
===================================================================
--- trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/Expression.cs
2008-02-17 20:12:19 UTC (rev 95996)
+++ trunk/mono-tools/gendarme/rules/Gendarme.Rules.Smells/Expression.cs
2008-02-17 20:16:57 UTC (rev 95997)
@@ -60,13 +60,10 @@
public override bool Equals (object obj)
{
- if (!(obj is Expression))
- throw new ArgumentException ("The value
argument should be an Expression", "value");
- if (obj == null)
+ Expression targetExpression = (obj as Expression);
+ if (targetExpression == null)
return false;
- Expression targetExpression = (Expression) obj;
-
if (HasSameSize (targetExpression))
return CompareInstructionsInOrder
(targetExpression);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches