spring-projects / spring-projects/spring-tools
Refactoring rename support for SpEL literals that references other code
Nobody has claimed this yet.
- 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

So it would be great if the refactor rename action also considers SpEL literals.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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