Re: [Codenarc-user] UnusedMethodParameter rule with inheritance
Brought to you by:
chrismair
From: Hamlet D'A. <ham...@gm...> - 2011-12-15 12:32:43
|
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? > > 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 > > |