mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
This commit adds a "Lifecycle and Reuse" section to the SpEL reference documentation, immediately following the security considerations introduced for gh-36997, explaining that AST nodes within a parsed Expression may cache resolved PropertyAccessor, IndexAccessor, MethodExecutor, and ConstructorExecutor instances for performance. We also now document that reusing a parsed Expression across EvaluationContext instances of the same type and with equivalent configuration is supported (even if atypical), including when accessors or resolvers registered with a context change between evaluations, but that reusing a parsed Expression across contexts with different security implications (for example, first against a StandardEvaluationContext and later against a SimpleEvaluationContext) is not supported, since cached state from a more permissive evaluation may be reused during a more restrictive one. The Javadoc for Expression, SpelExpression, EvaluationContext, StandardEvaluationContext, SimpleEvaluationContext, PropertyAccessor, IndexAccessor, MethodExecutor, and ConstructorExecutor has also been updated to make these contracts discoverable via the API as well. Closes gh-36968