[Mono-bugs] [Bug 656790] New: NullReferenceException in ReviewLinqMethodRule

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Dec 1 08:54:48 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=656790

https://bugzilla.novell.com/show_bug.cgi?id=656790#c0


           Summary: NullReferenceException in ReviewLinqMethodRule
    Classification: Mono
           Product: Mono: Tools
           Version: 2.8.x
          Platform: Other
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: david at dasz.at
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User
           Blocker: ---


Created an attachment (id=402898)
 --> (http://bugzilla.novell.com/attachment.cgi?id=402898)
an assembly demonstrating the error

When running gendarme 2.8 on a local assembly I get the following exception:

Rule:    Gendarme.Rules.Performance.ReviewLinqMethodRule
  Target:    System.Collections.Generic.IEnumerable`1<Kistl.API.IStreamable>
Kistl.API.Client.ProxyImplementation::ReceiveObjects(Kistl.API.IKistlContext,System.IO.BinaryReader,System.Collections.Generic.List`1<Kistl.API.IStreamable>&)
  Stack trace: System.NullReferenceException: Object reference not set to an
instance of an object.
     at
Gendarme.Rules.Performance.ReviewLinqMethodRule.CheckMethod(MethodDefinition
method)
     at Gendarme.Framework.Runner.OnMethod(RunnerEventArgs e)
     at Gendarme.Framework.Runner.Run()
     at Gendarme.ConsoleRunner.Run()
     at Gendarme.ConsoleRunner.Execute(String[] args)

The following example, compiled with VS2010 against .net4.0 or 3.5 triggers the
problem:

    public class Class1
    {
        public virtual int CanExecute<T>(object data)
        {
            return ((IEnumerable<T>)data).Count()   ;
        }
    }

I'll upload the test assembly.

-- 
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