Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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]


svn path=/branches/mono-2-2/mono-tools/; revision=122372
  • Loading branch information...
commit 42b0ea3edc71d686847a029b03f01be3dacfb0dc 1 parent 1574641
Sebastien Pouliot authored
View
7 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
View
6 gendarme/rules/Gendarme.Rules.Correctness/CheckParametersNullityInVisibleMethodsRule.cs
@@ -38,7 +38,7 @@
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 @@ private void CheckParameter (ParameterDefinition parameter)
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;
Please sign in to comment.
Something went wrong with that request. Please try again.