
Claude Code's java-refactoring-remove-parameter skill identifies and removes unused or redundant parameters from Java methods to improve code readability and maintainability. It is designed for Java developers who want to refactor their codebase by eliminating unnecessary method parameters that can be derived from class fields, constants, or other method calls. The skill solves the problem of parameter bloat and complexity by analyzing methods, removing superfluous parameters from both method definitions and their internal calls, while ensuring the refactored code remains functionally equivalent and compilable.
$ npx -y skills add github/awesome-copilot --skill java-refactoring-remove-parameter --agent claude-codeInstalls into .claude/skills of the current project.
You are an expert in refactoring Java methods.
Below are 2 examples (with titles code before and code after refactoring) that represents Remove Parameter.
public Backend selectBackendForGroupCommit(long tableId, ConnectContext context, boolean isCloud)
throws LoadException, DdlException {
if (!Env.getCurrentEnv().isMaster()) {
try {
long backendId = new MasterOpExecutor(context)
.getGroupCommitLoadBeId(tableId, context.getCloudCluster(), isCloud);
return Env.getCurrentSystemInfo().getBackend(backendId);
} catch (Exception e) {
throw new LoadException(e.getMessage());
}
} else {
return Env.getCurrentSystemInfo()
.getBackend(selectBackendForGroupCommitInternal(tableId, context.getCloudCluster(), isCloud));
}
}
public Backend selectBackendForGroupCommit(long tableId, ConnectContext context)
throws LoadException, DdlException {
if (!Env.getCurrentEnv().isMaster()) {
try {
long backendId = new MasterOpExecutor(context)
.getGroupCommitLoadBeId(tableId, context.getCloudCluster());
return Env.getCurrentSystemInfo().getBackend(backendId);
} catch (Exception e) {
throw new LoadException(e.getMessage());
}
} else {
return Env.getCurrentSystemInfo()
.getBackend(selectBackendForGroupCommitInternal(tableId, context.getCloudCluster()));
}
}
NodeImpl( long id, long firstRel, long firstProp )
{
this( id, false );
}
NodeImpl( long id)
{
this( id, false );
}
./mvnw -q -Dtest=MyTest test, ./gradlew test --tests MyTest) or ./mvnw verify / ./gradlew build, and re-run after the change. If the baseline is red, stop and report.lsp-setup/jdtls) and grep across all modules, including tests. Also check:
@Override, abstract/default methods, functional interfaces, method references): the whole hierarchy must change together;getMethod, getDeclaredMethod, MethodHandle, proxies), and Spring/CDI/Quarkus/Jakarta annotated methods (@Bean, @EventListener, @Scheduled, @Inject, @Path, @Observes, @PostConstruct), which a compiler will not flag;@JsonCreator, @ConstructorBinding, readObject), and serialVersionUID impact;Apply Remove Parameter to improve readability, coupling and consistency.
Now, assess all methods with unused parameters and refactor them using Remove Parameter
Sponsors