Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
2008-08-11 Sebastien Pouliot <sebastien@ximian.com>
	* AvoidDeepInheritanceTreeRule.cs: Fix case where we can't resolve
	a base type.
	* AvoidUnnecessarySpecializationRule.cs: Fix case where we can't
	resolve the least type.


svn path=/branches/mono-2-0/mono-tools/; revision=110187
  • Loading branch information
Sebastien Pouliot committed Aug 12, 2008
1 parent 5be66b6 commit 67a5461
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Expand Up @@ -60,6 +60,8 @@ public RuleResult CheckType (TypeDefinition type)
int depth = 0;
while (type.BaseType != null) {
type = type.BaseType.Resolve ();
if (type == null)
break;
if (countExternalDepth || Runner.Assemblies.Contains (type.Module.Assembly))
depth++;
}
Expand Down
Expand Up @@ -201,7 +201,8 @@ private void UpdateParameterLeastType (ParameterReference parameter, StackEntryU
}

//if the best we could find is object, ignore this round
if (currentLeastType.FullName == "System.Object") continue;
if ((currentLeastType == null) || (currentLeastType.FullName == "System.Object"))
continue;

needUpdate = true;
break;
Expand Down
7 changes: 7 additions & 0 deletions gendarme/rules/Gendarme.Rules.Maintainability/ChangeLog
@@ -1,3 +1,10 @@
2008-08-11 Sebastien Pouliot <sebastien@ximian.com>

* AvoidDeepInheritanceTreeRule.cs: Fix case where we can't resolve
a base type.
* AvoidUnnecessarySpecializationRule.cs: Fix case where we can't
resolve the least type.

2008-08-07 Sebastien Pouliot <sebastien@ximian.com>

* AvoidUnnecessarySpecializationRule.cs: Small fixes for self-test
Expand Down

0 comments on commit 67a5461

Please sign in to comment.