#249 Limit UnusedParameter check to private and static methods

release_3.4
closed
Check (274)
5
2012-10-10
2003-08-12
Ulrich Obst
No

Hi,

I played a little with the UnusedParameter check in the
new 3.2 release. I found that the check is applied to
every method. But many public (or protected) methods
override methods in the superclass (or implement
methods of interfaces) and you have no choice to omit
the parameters you don't use.
Or, maybe the other way round, a base class declares a
parameter in a method which is designed to be
overridden, and subclassed might use the parameter, but
it is not used in the base class.
So, not using a parameter in public or protected
methods is OK!
I wouldn't say that the current implementation of the
check is useless, but it produces a lot of useless
messages.
It would be very useful to limit the check to private
or static methods (and constructors), where no
inheritence take place.
(It would be even more useful to check parameters of
public methods which have no implementation in the
superclasses, or which are no interface methods, but I
don't know if this is possible).

Greetings
ulli obst

Discussion

  • Logged In: YES
    user_id=746148

    Added ignoreNonLocal property.
    Committed to CVS for 3.4