groovy / groovy/groovy-eclipse

Fix rename of accessor method to non-accessor name

Open
#817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
681
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Consider the following:

class Foo {
  def getBar() {} // rename to "readBar"
  void setBar(value) {} // rename to "writeBar"
}

new Foo().with {
  def x = bar // "bar" should be replaced by "readBar()"
  bar = x // "bar = x" should be replaced by "writeBar(x)"
}

If "getBar" is renamed to a non-accessor style name line "readBar" the property access is not properly refactored to "readBar()".

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Foo example in the Groovy Eclipse refactoring workflow, focusing on renaming getBar and setBar to readBar and writeBar. Trace how property reads and writes are transformed during the rename. Done means the read becomes readBar() and the assignment becomes writeBar(x), without the accessor-style names.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.