spring-projects / spring-projects/spring-tools
Advanced Validation for Annotations with Spring Expression Language
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 (which is tackled here https://github.com/spring-projects/sts4/issues/521) it is hard to notice that the @CacheEvict does not work anymore as expected.
So, what's needed here is a deeper validation at compile time to check if the expression is sound. In this case, if the referenced field of the parameter's type exists.
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
Read the linked issues #475 and #521 first, then locate the existing annotation and Spring Expression Language validation entry points in the tooling. The work is complete when an expression such as @CacheEvict(key = "#customer.customerId") is checked against the parameter type and an invalid renamed field is reported at compile time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- devtools, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100