Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Validation for Annotations with Spring Expression Language #520

Open
MahatmaFatalError opened this issue Aug 10, 2020 · 0 comments

Comments

@MahatmaFatalError
Copy link

MahatmaFatalError commented Aug 10, 2020

Follow up of #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 #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.

@martinlippert martinlippert added this to the 4.9.0.RELEASE milestone Aug 14, 2020
@martinlippert martinlippert removed this from the 4.13.0.RELEASE milestone Dec 16, 2021
@martinlippert martinlippert added this to the Backlog milestone Feb 24, 2023
@martinlippert martinlippert changed the title Validation for Annotations with Spring Expression Language Advanced Validation for Annotations with Spring Expression Language Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants