groovy / groovy/groovy-eclipse

Rename of static accessor method fails to rename property-style access w/o object expression

Open
#682 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:

package a
class B {
  static def getX() {}
}
import static a.B.getX
x

x is a static method call expression for getX. Renaming getX in B properly renames the static import reference, but fails to rename the static method call expression.

Note: This happens because the static import is renamed in the first phase of the rename refactoring. Then the rename participant is called to find property-style accesses. At that time, type inferencing cannot establish the connection between the expression x and the static import, which now refers to the new name for the accessor.

See #678 for more details

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

Reproduce the rename refactoring with the Groovy classes and static import shown in the issue, then trace the static import rename and the later property-style access lookup. Use #678 for related context. Done means renaming getX also updates the property-style x call without breaking the static import reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.