Unused parameters in the JDK

11 Jul 2006

Here's another entry along the same lines as 'try without catch in the JDK'. After making some enhancements to PMD's unused parameter rule I ran it on the JDK source to see what turned up. This rule only checks private methods since public methods frequently have unused parameters due to interface implementation requirements. Anyhow, here are some notes:

Another example that turns up in a few places is related to serialization. Some classes declare the private writeObject method but they just throw an exception rather than using the ObjectOutputStream parameter. Might be worth adding an exception to the rule for this method name since that's effectively a false positive...

For much more along these lines, get the PMD book!