Skip to content

Releases: pfichtner/java-refactoring-mcp

v0.1.3

Choose a tag to compare

@github-actions github-actions released this 25 Sep 12:39

Release v0.1.3

New Features

Locator: position + name cross-validation

A locator can now accept both a character offset / line number and a name at the same time. When both are supplied, the resolved AST node is validated against the name — a clear error is raised if they disagree instead of silently acting on the wrong target.

# CLI — both flags accepted, cross-validated
--line 42 --name updateQuality

MCP: apply-by-default with dryrun preview

All MCP tools now apply changes to disk by default. Pass "dryrun": true to preview the diff without writing, then call again without it to apply. This matches the IDE model and removes the extra opt-in round-trip.

Bug Fixes

  • MCP list_refactorings — the tool list is now rendered directly from the live tool registry, so it is always in sync with the tools actually installed.

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 23 Sep 22:59

What's new

change_method_signature — change parameter types (param_types)

The signature refactoring now accepts a param_types option to substitute
parameter types without removing or adding parameters:

  • param_types alone applies type changes to the declaration only
    (e.g. int → long).
  • Combined with paramOrder, the type substitutions are woven into the
    reordered parameter text, so both axes compose.
  • Overloaded-target disambiguation also landed: identical tool descriptions
    across operations were tightened, and remove_param now cross-references
    change_method_signature for the "change type without removal" case.

CLI: --param-types option added to ChangeMethodSignatureCommand.

widen_visibility option for pull-up and move refactorings

Five refactorings that move members across class/package boundaries gain a
boolean widen_visibility option (default true):

  • pull_up_field / pull_up_method: private → protected in the superclass
  • move_method: private → package-private (same package) or public (cross-package)
  • move_static_member: same minimum-required visibility logic
  • move_class: package-private class → public when crossing packages

Existing call signatures are unchanged (they delegate with true). Ten new
approval tests cover the true/false pair per refactoring.

Full Changelog: v0.1.1...v0.1.2

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 21 Sep 14:05

New Features

  • remove_method — Remove a method from a class or interface. By default (cascade=true) also removes every overriding method in subclasses and every implementing method in implementing classes. Returns a map of changed files.
    project_root=<absolute project root>
    file=<absolute path to source file>
    method=<method name>          # name-based locator
    cascade=false                 # optional, default true

Breaking Changes

  • move_method and move_static_member now require fully-qualified target class names. Pass gildedrose.AgedBrieUpdater instead of AgedBrieUpdater. Bare simple names are rejected.

Bug Fixes

  • rename_package — changed files are now returned sorted by path, giving deterministic output regardless of filesystem ordering.

Demo

  • The Gilded Rose chain-of-responsibility demo (gilded-rose-demo/) has been updated to showcase remove_method in the CONTRACT phase: after introducing the chain dispatch, the four dead delegation stubs are removed one by one via remove_method, leaving a clean final GildedRose.java. Both asciinema recordings have been re-recorded.

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 20 Sep 21:31
java-refactoring-mcp 0.1.0