# Remove Unused Parameters in Private Methods
# Description
This rule finds and removes unused parameters in private method declarations. Consequently, all the invocations of the affected methods are updated accordingly.
# Benefits
Removes the clutter and simplifies the method declarations.
# Tags
# Code Changes
Pre
/**
* Java doc for the affected method
*
* @param first discarded parameter
* @param second used parameter
* @param third discarded parameter
*/
private void discardedParameters(String first, String second, String third) {
consume(second);
}
void invocationSample() {
discardedParameters("first", "second", "third");
}
Post
/**
* Java doc for the affected method
*
* @param second used parameter
*/
private void discardedParameters(String second) {
consume(second);
}
void invocationSample() {
discardedParameters("second");
}
# Limitations
The non-private methods are not modified by this rule because they could be invoked or overridden in locations that are not reachable by jSparrow.
You Want To Have Those Changes Done Automatically?
The automatic application of this rule is supported in the following jSparrow version: