Re: [Codenarc-user] UnusedMethodParameter rule with inheritance
Brought to you by:
chrismair
From: Roshan D. <ros...@gm...> - 2011-12-15 12:45:04
|
On Thu, Dec 15, 2011 at 6:07 PM, Hamlet D'Arcy <ham...@gm...> wrote: > Ah, I see. I had it backwards. The rule should ignore this by default. > Does it seem worth filing an issue then? where? > In the meantime, does @SuppressWarnings solve the problem? > I have worked around it in a different way for now. > -- > Hamlet D'Arcy > ham...@gm... > > On Dec 15, 2011 1:34 PM, "Roshan Dawrani" <ros...@gm...> wrote: > >> User @Override in class A? Does that make sense? I am not overriding a >> superclass method in A.foo(). >> >> On Thu, Dec 15, 2011 at 6:02 PM, Hamlet D'Arcy <ham...@gm...>wrote: >> >>> Use the @Override to make it go away. In general, codenarc expects >>> @Override to be used. There are other rules that expect it too. >>> >>> -- >>> Hamlet D'Arcy >>> ham...@gm... >>> >>> On Dec 15, 2011 1:03 PM, "Roshan Dawrani" <ros...@gm...> >>> wrote: >>> >>>> Hi, >>>> >>>> For the code below, CodeNarc complains that A.foo() does not use method >>>> parameter 'x'. In the base implementation, there is no need to use 'x', but >>>> the subclasses do. >>>> >>>> Is there any way I can avoid this warning for class A? >>>> >>>> McAfee SiteAdvisor Warning >>>> This e-mail message contains potentially unsafe links to these sites: >>>> lucy.me [image: more info...]<http://www.siteadvisor.com/sites/lucy.me?pip=false&premium=true&client_uid=1010617928&client_ver=3.4.0.143&client_type=IEPlugin&suite=true&aff_id=0&locale=en_au&ui=1&os_ver=6.1.1.0> >>>> McAfee SiteAdvisor Warning >>>> This e-mail message contains potentially unsafe links to these sites: >>>> lucy.me [image: more info...]<http://www.siteadvisor.com/sites/lucy.me?pip=false&premium=true&client_uid=1010617928&client_ver=3.4.0.143&client_type=IEPlugin&suite=true&aff_id=0&locale=en_au&ui=1&os_ver=6.1.1.0> >>>> class A { >>>> protected foo(x) { >>>> // base implementation leaves x unused >>>> } >>>> } >>>> >>>> class B extends A { >>>> protected foo(x) { >>>> // this overridden implementation uses x >>>> } >>>> } >>>> >>>> -- >>>> Roshan >>>> Lucy.me: http://www.lucy.me/roshan >>>> Blog: http://roshandawrani.wordpress.com/ >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> 10 Tips for Better Server Consolidation >>>> Server virtualization is being driven by many needs. >>>> But none more important than the need to reduce IT complexity >>>> while improving strategic productivity. Learn More! >>>> http://www.accelacomm.com/jaw/sdnl/114/51507609/ >>>> _______________________________________________ >>>> Codenarc-user mailing list >>>> Cod...@li... >>>> https://lists.sourceforge.net/lists/listinfo/codenarc-user >>>> >>>> >> -- Roshan Lucy.me: http://www.lucy.me/roshan Blog: http://roshandawrani.wordpress.com/ |