Development
java-refactoring-remove-parameter - Claude MCP Skill
Refactoring using Remove Parameter in Java Language
SEO Guide: Enhance your AI agent with the java-refactoring-remove-parameter tool. This Model Context Protocol (MCP) server allows Claude Desktop and other LLMs to refactoring using remove parameter in java language... Download and configure this skill to unlock new capabilities for your AI workflow.
Documentation
SKILL.md# 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:
```java
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));
}
}
```
## Code After Refactoring 1:
```java
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()));
}
}
```
## Code Before Refactoring 2:
```java
NodeImpl( long id, long firstRel, long firstProp )
{
this( id, false );
}
```
## Code After Refactoring 2:
```java
NodeImpl( long id)
{
this( id, false );
}
```
## Safety Rules
- Behaviour-preserving only. Remove a parameter only if it is truly unused or derivable (field, constant, other parameter); never remove one that is read, even if "redundant" by convention.
- Baseline first: run the narrowest green test command (`./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.
- If the affected code has no tests, stop and report; propose characterization tests first. Never delete or weaken tests.
- Find every usage before changing a signature: use LSP find-references (`lsp-setup`/jdtls) and grep across all modules, including tests. Also check:
- overrides and interface implementors (`@Override`, abstract/default methods, functional interfaces, method references): the whole hierarchy must change together;
- reflection and string-based lookups (`getMethod`, `getDeclaredMethod`, `MethodHandle`, proxies), and Spring/CDI/Quarkus/Jakarta annotated methods (`@Bean`, `@EventListener`, `@Scheduled`, `@Inject`, `@Path`, `@Observes`, `@PostConstruct`), which a compiler will not flag;
- constructors used by serialization/deserialization or JPA/Jackson (`@JsonCreator`, `@ConstructorBinding`, `readObject`), and `serialVersionUID` impact;
- XML/properties/YAML configuration and AOP pointcut expressions naming the method;
- public or protected API consumed by other modules or published artifacts.
- Ask the user before changing public/protected/published API (prefer deprecating and adding an overload) or touching generated code.
- One parameter per step (one commit each when the user asks for commits). Prefer the jdtls Change Method Signature refactoring when available; otherwise update the declaration and all callers together.
- Removing a parameter can make an overload collide with an existing signature or change overload resolution; check this. Evaluating the argument at the call site may have had side effects: keep them if they matter.
## Task
Apply **Remove Parameter** to improve readability, coupling and consistency.
1. Identify unused or derivable parameters.
2. Remove each from the declaration and from all callers, then compile and run the tests.
3. Add a one-line comment only where the removal is non-obvious; otherwise explain it in the report.
4. Report parameters removed, callers updated, the commands run and their results, and anything left unverified (e.g. reflective or external callers).
## Code to be Refactored:
Now, assess all methods with unused parameters and refactor them using **Remove Parameter**Signals
Information
- Repository
- github/awesome-copilot
- Author
- github
- Last Sync
- 11/3/2026
- Repo Updated
- 11/3/2026
- Created
- 2/25/2026
Reviews (0)
No reviews yet. Be the first to review this skill!
Related Skills
cursorrules
CrewAI Development Rules
firecrawl-build-onboarding
Get Firecrawl credentials and SDK setup into a project. Use when an application needs `FIRECRAWL_API_KEY`, when an agent should add Firecrawl to `.env`, when the user wants to authenticate Firecrawl for app code, or when choosing the first SDK and docs for a new Firecrawl integration. This skill includes its own browser auth flow, so it does not depend on the website onboarding skill.
firecrawl-build-search
Integrate Firecrawl `/search` into product code and agent workflows. Use when an app needs discovery before extraction, when the feature starts with a query instead of a URL, or when the system should search the web and optionally hydrate result content.
firecrawl-build
Integrate Firecrawl into application code whenever a product, agent, or workflow needs web data inside the app — web search, live search results, page scraping, structured extraction, or browser interaction. Use when building any feature that needs data from the web in code, even if the user does not mention Firecrawl explicitly and only describes wanting web data, website content, search, scraping, or interaction in an application. Trigger for Firecrawl requests, "fire girl" shorthand, and generic app-level web-data needs that should map to `/scrape`, `/search`, or `/interact`. Do not use this skill for one-off terminal-only web tasks during the current session; use `firecrawl/cli` for those.
Related Guides
Bear Notes Claude Skill: Your AI-Powered Note-Taking Assistant
Learn how to use the bear-notes Claude skill. Complete guide with installation instructions and examples.
OpenAI Whisper API Claude Skill: Complete Guide to AI-Powered Audio Transcription
Learn how to use the openai-whisper-api Claude skill. Complete guide with installation instructions and examples.
Mastering the Oracle CLI: A Complete Guide to the Claude Skill for Database Professionals
Learn how to use the oracle Claude skill. Complete guide with installation instructions and examples.