https://bugzilla.novell.com/show_bug.cgi?id=672206
https://bugzilla.novell.com/show_bug.cgi?id=672206#c0 Summary: AvoidMethodWithUnusedGenericType should not be violated / should have severity reduced on a method that delegates the T to another method call Classification: Mono Product: Mono: Tools Version: 2.10.x Platform: 64bit OS/Version: Windows 7 Status: NEW Severity: Normal Priority: P5 - None Component: Gendarme AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.18 Safari/534.16 With a generic method block that accepts generic parameter T, and uses that T as a generic parameter to another method, this rule fires. For instance, code like this (a helper method inside a set of unit tests): private IHttpHandler CreateHandler<T>() where T: IHttpHandler { var routeHandler = new HttpHandlerRouteHandlerResolver<T>(); return routeHandler.GetHttpHandler(A.Dummy<RequestContext>()); } An instance of T is not passed, because we don't want an instance of T, we only care about the Type itself when passing it to a generic class. A test case exists here: https://github.com/Iristyle/mono-tools/commit/8f51653630ab437dfcf965a1b4d2aaa25f7b8ee6 Reproducible: Always Steps to Reproduce: 1.Run the provided test case 2. 3. Actual Results: Generates a violation of AvoidMethodWithUnusedGenericType with Severity.Medium Expected Results: I personally think this should not cause a violation. -- 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
