{"id":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","shortId":"DYgRvv","kind":"skill","title":"java-refactoring-remove-parameter","tagline":"Refactoring using Remove Parameter in Java Language","description":"# Refactoring Java Methods with Remove Parameter\n\n## Role\n\nYou are an expert in refactoring Java methods.\n\nBelow are **2 examples** (with titles code before and code after refactoring) that represents **Remove Parameter**.\n\n## Code Before Refactoring 1:\n```java\npublic Backend selectBackendForGroupCommit(long tableId, ConnectContext context, boolean isCloud)\n        throws LoadException, DdlException {\n    if (!Env.getCurrentEnv().isMaster()) {\n        try {\n            long backendId = new MasterOpExecutor(context)\n                    .getGroupCommitLoadBeId(tableId, context.getCloudCluster(), isCloud);\n            return Env.getCurrentSystemInfo().getBackend(backendId);\n        } catch (Exception e) {\n            throw new LoadException(e.getMessage());\n        }\n    } else {\n        return Env.getCurrentSystemInfo()\n                .getBackend(selectBackendForGroupCommitInternal(tableId, context.getCloudCluster(), isCloud));\n    }\n}\n```\n\n## Code After Refactoring 1:\n```java\npublic Backend selectBackendForGroupCommit(long tableId, ConnectContext context)\n        throws LoadException, DdlException {\n    if (!Env.getCurrentEnv().isMaster()) {\n        try {\n            long backendId = new MasterOpExecutor(context)\n                    .getGroupCommitLoadBeId(tableId, context.getCloudCluster());\n            return Env.getCurrentSystemInfo().getBackend(backendId);\n        } catch (Exception e) {\n            throw new LoadException(e.getMessage());\n        }\n    } else {\n        return Env.getCurrentSystemInfo()\n                .getBackend(selectBackendForGroupCommitInternal(tableId, context.getCloudCluster()));\n    }\n}\n```\n\n## Code Before Refactoring 2:\n```java\nNodeImpl( long id, long firstRel, long firstProp )\n{\n     this( id, false );\n}\n```\n\n## Code After Refactoring 2:\n```java\nNodeImpl( long id)\n{\n     this( id, false );\n}\n```\n\n## Task\n\nApply **Remove Parameter** to improve readability, testability, maintainability, reusability, modularity, cohesion, low coupling, and consistency.\n\nAlways return a complete and compilable method (Java 17).\n\nPerform intermediate steps internally:\n- 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).\n- For each qualifying method, remove the unnecessary parameters from its definition and from all its internal calls.\n- Ensure that the method continues to function correctly after parameter removal.\n- Output only the refactored code inside a single ```java``` block.\n- Do not remove any functionality from the original method.\n- Include a one-line comment above each modified method indicating which parameter was removed and why.\n\n## Code to be Refactored:\n\nNow, assess all methods with unused parameters and refactor them using **Remove Parameter**","tags":["java","refactoring","remove","parameter","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest"],"capabilities":["skill","source-github","skill-java-refactoring-remove-parameter","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/java-refactoring-remove-parameter","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (2,835 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:15.319Z","embedding":null,"createdAt":"2026-04-18T20:26:03.075Z","updatedAt":"2026-05-18T18:52:15.319Z","lastSeenAt":"2026-05-18T18:52:15.319Z","tsv":"'1':47,96 '17':188 '2':30,141,156 'alway':180 'analyz':194 'appli':165 'assess':288 'backend':50,99 'backendid':66,77,113,123 'block':256 'boolean':56 'call':218,235 'catch':78,124 'class':212 'code':34,37,44,93,138,153,251,283 'cohes':175 'comment':271 'compil':185 'complet':183 'connectcontext':54,103 'consist':179 'constant':214 'context':55,69,104,116 'context.getcloudcluster':72,91,119,137 'continu':240 'correct':243 'coupl':177 'ddlexcept':60,107 'definit':229 'e':80,126 'e.getmessage':84,130 'els':85,131 'ensur':236 'env.getcurrentenv':62,109 'env.getcurrentsysteminfo':75,87,121,133 'exampl':31 'except':79,125 'expert':23 'fals':152,163 'field':213 'first':193 'firstprop':149 'firstrel':147 'function':242,261 'getbackend':76,88,122,134 'getgroupcommitloadbeid':70,117 'i.e':205 'id':145,151,160,162 'identifi':198 'improv':169 'includ':266 'indic':276 'insid':252 'intermedi':190 'intern':192,234 'iscloud':57,73,92 'ismast':63,110 'java':2,11,14,26,48,97,142,157,187,255 'java-refactoring-remove-paramet':1 'languag':12 'line':270 'loadexcept':59,83,106,129 'long':52,65,101,112,144,146,148,159 'low':176 'maintain':172 'masteropexecutor':68,115 'method':15,27,186,196,217,222,239,265,275,290 'modifi':274 'modular':174 'new':67,82,114,128 'nodeimpl':143,158 'obtain':210 'one':269 'one-lin':268 'origin':264 'output':247 'paramet':5,9,18,43,167,199,226,245,278,293,299 'perform':189 'public':49,98 'qualifi':221 'readabl':170 'redund':204 'refactor':3,6,13,25,39,46,95,140,155,250,286,295 'remov':4,8,17,42,166,223,246,259,280,298 'repres':41 'return':74,86,120,132,181 'reusabl':173 'role':19 'selectbackendforgroupcommit':51,100 'selectbackendforgroupcommitintern':89,135 'singl':254 'skill' 'skill-java-refactoring-remove-parameter' 'source-github' 'step':191 'tableid':53,71,90,102,118,136 'task':164 'testabl':171 'throw':58,81,105,127 'titl':33 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'tri':64,111 'unnecessari':225 'unus':202,292 'use':7,297 'valu':206","prices":[{"id":"6044126b-e327-4985-a76b-f55a6f10f0c9","listingId":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:26:03.075Z"}],"sources":[{"listingId":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","source":"github","sourceId":"github/awesome-copilot/java-refactoring-remove-parameter","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/java-refactoring-remove-parameter","isPrimary":false,"firstSeenAt":"2026-04-18T21:49:57.920Z","lastSeenAt":"2026-05-18T18:52:15.319Z"},{"listingId":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","source":"skills_sh","sourceId":"github/awesome-copilot/java-refactoring-remove-parameter","sourceUrl":"https://skills.sh/github/awesome-copilot/java-refactoring-remove-parameter","isPrimary":true,"firstSeenAt":"2026-04-18T20:26:03.075Z","lastSeenAt":"2026-05-07T22:40:18.588Z"}],"details":{"listingId":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"java-refactoring-remove-parameter","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"6149fbe1d5e72996f2049decdf0053becd2553cc","skill_md_path":"skills/java-refactoring-remove-parameter/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/java-refactoring-remove-parameter"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"java-refactoring-remove-parameter","description":"Refactoring using Remove Parameter in Java Language"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/java-refactoring-remove-parameter"},"updatedAt":"2026-05-18T18:52:15.319Z"}}