Java Refactoring

Refactoring mechanics for Java: characterisation tests, small reversible steps, what behaviour preservation actually covers, risk classification, and the catalogue — Extract/Inline, Split Phase, guard clauses, Remove Flag Argument, Pull Up and Push Down, Replace Conditional with Polymorphism or sealed types. What to detect is java-code-smells; evolution rules for published APIs are java-api-design. Use when restructuring code without changing behaviour, when a change is needed in code that has no tests, when a method resists extraction because everything shares locals, when inverting a condition into a guard clause, when converting an instanceof chain to a switch, when moving members through a hierarchy, or when you need to know whether a step crosses a lock, transaction, serialisation or published boundary and must stop. Getting a class that constructs its own dependencies into a harness in the first place is java-legacy-code-testing.

robsonkades 98147cd 10 files · 83.5 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/java-refactoring commit 98147cd06a

Frequently asked questions

npx skillmds@latest add robsonkades/java-refactoring