java-refactoring-remove-parameter by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill java-refactoring-remove-parameter您是一位 Java 方法重构专家。
以下是代表移除参数的 2 个示例(包含重构前代码和重构后代码的标题)。
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()));
}
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
NodeImpl( long id, long firstRel, long firstProp )
{
this( id, false );
}
NodeImpl( long id)
{
this( id, false );
}
应用移除参数来改进可读性、可测试性、可维护性、可重用性、模块化、内聚性、低耦合性和一致性。
始终返回一个完整且可编译的方法(Java 17)。
内部执行中间步骤:
java 代码块内输出重构后的代码。现在,评估所有带有未使用参数的方法,并使用移除参数对它们进行重构
每周安装量
7.3K
代码仓库
GitHub 星标数
26.7K
首次出现
2026年2月25日
安全审计
安装于
codex7.2K
gemini-cli7.2K
opencode7.2K
github-copilot7.2K
cursor7.2K
kimi-cli7.2K
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 );
}
Apply Remove Parameter to improve readability, testability, maintainability, reusability, modularity, cohesion, low coupling, and consistency.
Always return a complete and compilable method (Java 17).
Perform intermediate steps internally:
java block.Now, assess all methods with unused parameters and refactor them using Remove Parameter
Weekly Installs
7.3K
Repository
GitHub Stars
26.7K
First Seen
Feb 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex7.2K
gemini-cli7.2K
opencode7.2K
github-copilot7.2K
cursor7.2K
kimi-cli7.2K
97,600 周安装