Install
openclaw skills install skills-sh:github/awesome-copilot/java-refactoring-remove-parameterRefactoring Java Methods with Remove Parameter ## Role You are an expert in refactoring Java methods. Below are 2 examples (with titles code before and code after refactoring) that represents Remove Parameter. ## Code Before Refactoring 1: java public Backend…
openclaw skills install skills-sh:github/awesome-copilot/java-refactoring-remove-parameterYou 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
2d4b998d2df2