Source profileQuality 66/100

github/awesome-copilot/skills/java-refactoring-remove-parameter/SKILL.md

java-refactoring-remove-parameter

Refactoring using Remove Parameter in Java Language

Source repository stars
37,126
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Refactoring using Remove Parameter in Java Language

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/github/awesome-copilot --skill "skills/java-refactoring-remove-parameter"
    Safe inspection promptEditorial

    Inspect the Agent Skill "java-refactoring-remove-parameter" from https://github.com/github/awesome-copilot/blob/9933dcad5be5caeb288cebcd370eeeb2fc2f1685/skills/java-refactoring-remove-parameter/SKILL.md at commit 9933dcad5be5caeb288cebcd370eeeb2fc2f1685. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      Role

      You are an expert in refactoring Java methods.

      You are an expert in refactoring Java methods.Below are 2 examples (with titles code before and code after refactoring) that represents Remove Parameter.
    2. 02

      Code Before Refactoring 1:

      Review the “Code Before Refactoring 1:” section in the pinned source before continuing.

      Review and apply the “Code Before Refactoring 1:” source section.
    3. 03

      Code After Refactoring 1:

      Review the “Code After Refactoring 1:” section in the pinned source before continuing.

      Review and apply the “Code After Refactoring 1:” source section.
    4. 04

      Code Before Refactoring 2:

      Review the “Code Before Refactoring 2:” section in the pinned source before continuing.

      Review and apply the “Code Before Refactoring 2:” source section.

    Permission review

    Static risk signals and limitations

    No configured static risk pattern was detected

    This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score66/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars37,126SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    github/awesome-copilot
    Skill path
    skills/java-refactoring-remove-parameter/SKILL.md
    Commit
    9933dcad5be5caeb288cebcd370eeeb2fc2f1685
    License
    MIT
    Collected
    2026-07-28
    Default branch
    main
    View the original 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:

    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:

    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:

    NodeImpl( long id, long firstRel, long firstProp )
    {
         this( id, false );
    }
    

    Code After Refactoring 2:

    NodeImpl( 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

    Alternatives

    Compare before choosing