Skip to content

Advanced Validation for Annotations with Spring Expression Language #520

Open
@MahatmaFatalError

Description

@MahatmaFatalError

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions