[Mono-bugs] [Bug 695327] New: AvoidUncalledPrivateCodeRule - false positive

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 22 17:57:33 EDT 2011



           Summary: AvoidUncalledPrivateCodeRule - false positive
    Classification: Mono
           Product: Mono: Tools
           Version: 2.10.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dumbass at wp.pl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; pl-PL; rv:
Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17

See the following code:
public class Class1
public void Access() { new Class3().RunTest(); }
internal class Class2
protected virtual void Test() {}
public void RunTest() { Test(); }
internal class Class3 : Class2
protected sealed override void Test() { base.Test(); }

Gendarme claims that method Class3:Test() is never called, which is not true.

I think that replacing:
 if (method.IsVirtual && !method.IsFinal) 
 if (method.IsVirtual) 
in Gendarme.Rules.Performance.AvoidUncalledPrivateCodeRule:CheckMethod() should
fix this bug.

Reproducible: Always

Steps to Reproduce:

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list