[Mono-bugs] [Bug 590750] New: ProvideCorrectArgumentsToFormattingMethodsRule fired false positive

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Mar 24 05:42:57 EDT 2010


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

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


           Summary: ProvideCorrectArgumentsToFormattingMethodsRule fired
                    false positive
    Classification: Mono
           Product: Mono: Tools
           Version: unspecified
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: avandecreme at sopragroup.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.8)
Gecko/20100202 Firefox/3.5.8

The rules doesn't detect correctly the parameters of string.Format (in the
method GetLoadStringInstruction) if the first parameter is passed using a
function.
In this case, it will return the last string found which can actually be the
second/third... parameter to string.Format.

This is a real problem because when we use the resources system, the first
parameter is always a call to a static property (SR.MyResource).

Reproducible: Always

Steps to Reproduce:
Write this code : 

            private string GetFooFormatting()
            {
                return "Foo {0}";
            }

            public void MethodWithGoodFormattingAndStringResource()
            {
                String.Format(GetFooFormatting(), "bar");
            }
Actual Results:  
Error : Extra parameters

Expected Results:  
In a first time, should return RuleResult.DoesNotApply.

Then, it would be really nice to detect call to resources and try to check the
default culture format.

The code is compiled using visual studio 2008 (.Net 3.5).

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


More information about the mono-bugs mailing list