diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2009-01-03 21:15:57 +0300 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2009-01-03 21:15:57 +0300 |
commit | 42b0ea3edc71d686847a029b03f01be3dacfb0dc (patch) | |
tree | 0518c12d1afb861a53ee16b1a8cb4438679e4501 | |
parent | 1574641b23aeb0c168390ae7b90ec7717688dec5 (diff) |
* CheckParametersNullityInVisibleMethodsRule.cs: Fix case
for out parameters which were not ignored for arrays.
[Fix #463003]
[Backport of r122369]
svn path=/branches/mono-2-2/mono-tools/; revision=122372
-rw-r--r-- | gendarme/rules/Gendarme.Rules.Correctness/ChangeLog | 7 | ||||
-rw-r--r-- | gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog b/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog index c80e406f..d1a04a85 100644 --- a/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog +++ b/gendarme/rules/Gendarme.Rules.Correctness/ChangeLog @@ -1,3 +1,10 @@ +2009-01-03 Sebastien Pouliot <sebastien@ximian.com> + + * CheckParametersNullityInVisibleMethodsRule.cs: Fix case + for out parameters which were not ignored for arrays. + [Fix #463003] + [Backport of r122369] + 2008-12-29 Sebastien Pouliot <sebastien@ximian.com> * ReviewSelfAssignmentRule.cs: Fix the check when a call chain diff --git a/gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs b/gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs index fcfb8d74..b579bf1c 100644 --- a/gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs +++ b/gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs @@ -38,7 +38,7 @@ using Gendarme.Framework.Rocks; namespace Gendarme.Rules.Correctness { [Problem ("A visible method does not check its parameter(s) for null values.")] - [Solution ("Since the caller is unkown you should always verify all of your parameters to protect yourself.")] + [Solution ("Since the caller is unknown you should always verify all of your parameters to protect yourself.")] [FxCopCompatibility ("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods")] public class CheckParametersNullityInVisibleMethodsRule : Rule, IMethodRule { @@ -53,6 +53,10 @@ namespace Gendarme.Rules.Correctness { if (parameter == null) return; + // out parameters can't be null + if (parameter.IsOut) + return; + // was there a null check done before ? if (has_null_check.Get (parameter.Sequence)) return; |