{"id":"51b9f9f0-e5cd-4a6d-9256-582265eeda63","shortId":"DYgRvv","kind":"skill","title":"Java Refactoring Remove Parameter","tagline":"Awesome Copilot skill by Github","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"],"capabilities":["skill","source-github","category-awesome-copilot"],"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":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","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:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T11:40:19.740Z","embedding":null,"createdAt":"2026-04-18T20:26:03.075Z","updatedAt":"2026-04-22T11:40:19.740Z","lastSeenAt":"2026-04-22T11:40:19.740Z","tsv":"'1':44,93 '17':185 '2':27,138,153 'alway':177 'analyz':191 'appli':162 'assess':285 'awesom':5 'backend':47,96 'backendid':63,74,110,120 'block':253 'boolean':53 'call':215,232 'catch':75,121 'category-awesome-copilot' 'class':209 'code':31,34,41,90,135,150,248,280 'cohes':172 'comment':268 'compil':182 'complet':180 'connectcontext':51,100 'consist':176 'constant':211 'context':52,66,101,113 'context.getcloudcluster':69,88,116,134 'continu':237 'copilot':6 'correct':240 'coupl':174 'ddlexcept':57,104 'definit':226 'e':77,123 'e.getmessage':81,127 'els':82,128 'ensur':233 'env.getcurrentenv':59,106 'env.getcurrentsysteminfo':72,84,118,130 'exampl':28 'except':76,122 'expert':20 'fals':149,160 'field':210 'first':190 'firstprop':146 'firstrel':144 'function':239,258 'getbackend':73,85,119,131 'getgroupcommitloadbeid':67,114 'github':9 'i.e':202 'id':142,148,157,159 'identifi':195 'improv':166 'includ':263 'indic':273 'insid':249 'intermedi':187 'intern':189,231 'iscloud':54,70,89 'ismast':60,107 'java':1,11,23,45,94,139,154,184,252 'line':267 'loadexcept':56,80,103,126 'long':49,62,98,109,141,143,145,156 'low':173 'maintain':169 'masteropexecutor':65,112 'method':12,24,183,193,214,219,236,262,272,287 'modifi':271 'modular':171 'new':64,79,111,125 'nodeimpl':140,155 'obtain':207 'one':266 'one-lin':265 'origin':261 'output':244 'paramet':4,15,40,164,196,223,242,275,290,296 'perform':186 'public':46,95 'qualifi':218 'readabl':167 'redund':201 'refactor':2,10,22,36,43,92,137,152,247,283,292 'remov':3,14,39,163,220,243,256,277,295 'repres':38 'return':71,83,117,129,178 'reusabl':170 'role':16 'selectbackendforgroupcommit':48,97 'selectbackendforgroupcommitintern':86,132 'singl':251 'skill':7 'source-github' 'step':188 'tableid':50,68,87,99,115,133 'task':161 'testabl':168 'throw':55,78,102,124 'titl':30 'tri':61,108 'unnecessari':222 'unus':199,289 'use':294 'valu':203","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-04-22T06:52:24.143Z"},{"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-04-22T11:40:19.740Z"}],"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","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/java-refactoring-remove-parameter"},"updatedAt":"2026-04-22T11:40:19.740Z"}}