spring-projects / spring-projects/spring-tools

Refactoring rename support for SpEL literals that references other code

Open
#521 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme: spel-support type: enhancement
Dominant language
Java
Stars
983
Forks
240
Avg merge
7d 1h
Merged PRs (30d)
7

Description

Follow up of https://github.com/spring-projects/sts4/issues/475

Considering this situation:

@CacheEvict(key = "#customer.customerId")
public void insert(Customer customer) {
	//some logic
}

Then assume to refactor rename the field customerId of the Customer class to e.g. just id. Since the cache key String literal is not considered by the refactoring action it is hard to notice that the @CacheEvict does not work anymore as expected.

Similarly, renaming a method parameter does not take the String literal into account
grafik

So it would be great if the refactor rename action also considers SpEL literals.

Contributor guide

Open the contributing guide

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 with the related issue 475, then trace the refactor rename action and its handling of SpEL literals. Done means renaming a referenced field or method parameter also accounts for occurrences such as the CacheEvict key shown here.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.