-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Improve SpEL inline collection caching #25921
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
Conversation
…e not cached Signed-off-by: Semyon Danilov <[email protected]>
For future reference, there was no need to close #25047. If you need to make changes to a PR, you can push additional commits to the PR branch and rebase on the latest |
@aclement, do you have time to review the proposal? |
It looks reasonable to me @sbrannen . The only concern I'd have is that we do allowable SpEL compilation of inline lists (not inline maps yet): In InlineList:
So maybe a few tests verifying compiled expressions using inline lists are still OK with the constant computation extended to include OpMinus nodes. I think it'll be ok from browsing the code, but worth testing. |
@aclement I just added tests verifying compilation, looks like it's still OK |
Hello! I wonder if we can proceed with the review and merge this? :) |
Rebased and merged, thanks for your contribution and sorry for the delay. |
This commit revises the contribution for gh-25921 in the following ways. - Use instanceof pattern matching - Use List.of() and Map.of() - Add missing @since tags - Polish Javadoc - Rename isNegativeNumber() to isNegativeNumberLiteral() - Restructure InlineCollectionTests using @Nested, etc. - Fix testListWithVariableNotCached() test: it previously set a SpEL "variable" but tested a "property" in the root context object, which effectively did not test anything. - Introduce additional tests: listWithPropertyAccessIsNotCached(), mapWithVariableIsNotCached(), and mapWithPropertyAccessIsNotCached().
Indeed, thanks for the PR, @SammyVimes! 👍 I unfortunately forgot about this PR and so only got around to reviewing it after it had been merged. You can see the result of my belated review in e7cf54d. |
This is a fix for #22146