http://bugzilla.novell.com/show_bug.cgi?id=567995

http://bugzilla.novell.com/show_bug.cgi?id=567995#c0


           Summary: InstantiateArgumentExceptionCorrectlyRule false
                    positive on indexer implementation
    Classification: Mono
           Product: Mono: Tools
           Version: 2.4.x
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs@lists.ximian.com
        ReportedBy: da...@dasz.at
         QAContact: mono-bugs@lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.38 Safari/532.0

The following class triggers two InstantiateArgumentExceptionCorrectlyRule
hits, although the ArgumentOutOfRangeException is correctly instantiated:

    public class Class2
    {
        public object this[int index]
        {
            get
            {
                throw new ArgumentOutOfRangeException("index");
            }
            set
            {
                throw new ArgumentOutOfRangeException("index", "foo");
            }
        }
    }

> Target: System.Object ClassLibrary1.Class2::get_Item(System.Int32)
> Assembly: ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
> 
> Severity: High  Confidence: Normal
> Source: P:\Misc\ClassLibrary1\ClassLibrary1\Class2.cs(≈14)
> 
> Target: System.Void ClassLibrary1.Class2::set_Item(System.Int32,System.Object)
> Assembly: ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
> 
> Severity: High  Confidence: Normal
> Source: P:\Misc\ClassLibrary1\ClassLibrary1\Class2.cs(≈18)

The line numbers correspond to the throw statements.

I've tested with 2.4 and the 2.6 preview with the same results.

Reproducible: Always

Steps to Reproduce:
1. Implement an indexer (this[int index]) which throws
ArgumentOutOfRangeException("index")
2. Test with Gendarme

Actual Results:  
The InstantiateArgumentExceptionCorrectlyRule matches on the thrown
ArgumentOutOfRangeException

Expected Results:  
The InstantiateArgumentExceptionCorrectlyRule should not match as long as the
paramName of ArgumentOutOfRangeException is correct

-- 
Configure bugmail: http://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.
_______________________________________________
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to