-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
SpEL context is wrong in method parameter resolution [SPR-6525] #11191
Comments
Andy Clement commented I posted on spr-dev but that is waiting moderation. Mark F mentioned this at spring one and I meant to look at it but ran out of time. The workaround is to qualify the reference in the parameter: placeOfBirth.doubleIt(#root.inventions.length) The behaviour should change as you suggest, but I'm inclined (because of the trivial workaround - if that does work!) to put it into 3.0.1 and 3.1. |
Sam Brannen commented In any case, please add a section to the reference manual covering "#root" in contrast to "#this". Thanks, Sam |
Dave Syer commented Yeuch. Ugly workaround for a really common use case. I think we should fix it, otherwise we are going to get a lot of support requests. Can't we just add the patch quickly and fix anything that crops up as a result in 3.0.1? The workaround does work, by the way. |
Andy Clement commented personally I prefer an RC to be an RC - so this would necessitate an RC4. but if everyone else thinks it should go in regardless and not require another RC I can be persuaded. |
Andy Clement commented Probably also affects constructor invocation and function invocation |
Andy Clement commented per Juergens comment, I'll look at this tomorrow. I will look at constructors and function invocation too. |
Andy Clement commented test and fix (per Dave's patch) is in. Added extra tests for function invocation, ctor invocation and a combined method/function invocation. Also added the, err, 'secret' #root to the docs. |
Stevo Slavić commented #10255 duplicates this issue. |
Dave Syer opened SPR-6525 and commented
SpEL context is wrong in method parameter resolution. Instead of using the current context for the stack (which refers to the method target), parameters should have a current context equal to the context root. This test would fail in EvaluationTests():
Affects: 3.0 RC3
Attachments:
Issue Links:
Referenced from: commits 33a7bbb
The text was updated successfully, but these errors were encountered: