Claude Agent Skill · by Github

Java Refactoring Remove Parameter

Claude Code's java-refactoring-remove-parameter skill identifies and removes unused or redundant parameters from Java methods to improve code readability and ma

Install
Terminal · npx
$npx skills add https://github.com/github/awesome-copilot --skill java-refactoring-remove-parameter
Works with Paperclip

How Java Refactoring Remove Parameter fits into a Paperclip company.

Java Refactoring Remove Parameter drops into any Paperclip agent that handles this kind of work. Assign it to a specialist inside a pre-configured PaperclipOrg company and the skill becomes available on every heartbeat — no prompt engineering, no tool wiring.

S
SaaS FactoryPaired

Pre-configured AI company — 18 agents, 18 skills, one-time purchase.

$27$59
Explore pack
Source file
SKILL.md84 lines
Expand
---name: java-refactoring-remove-parameterdescription: 'Refactoring using Remove Parameter in Java Language'--- # Refactoring 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:```javapublic 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));    }}``` ## Code After Refactoring 1:```javapublic 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()));    }}``` ## Code Before Refactoring 2:```javaNodeImpl( long id, long firstRel, long firstProp ){     this( id, false );}``` ## Code After Refactoring 2:```javaNodeImpl( long id){     this( id, false );}``` ## Task 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:- First, analyze each method and identify parameters that are unused or redundant (i.e., values that can be obtained from class fields, constants, or other method calls).- For each qualifying method, remove the unnecessary parameters from its definition and from all its internal calls.- Ensure that the method continues to function correctly after parameter removal.- Output only the refactored code inside a single ```java``` block.- Do not remove any functionality from the original method.- Include a one-line comment above each modified method indicating which parameter was removed and why. ## Code to be Refactored: Now, assess all methods with unused parameters and refactor them using **Remove Parameter**