SPR-6525: avoid need to use #root for method parameter references

This commit is contained in:
Andy Clement
2009-12-06 23:21:07 +00:00
parent e01c2eafa1
commit 33a7bbb485
3 changed files with 33 additions and 4 deletions

View File

@@ -52,7 +52,14 @@ public class MethodReference extends SpelNodeImpl {
TypedValue currentContext = state.getActiveContextObject();
Object[] arguments = new Object[getChildCount()];
for (int i = 0; i < arguments.length; i++) {
arguments[i] = children[i].getValueInternal(state).getValue();
// Make the root object the active context again for evaluating the parameter
// expressions
try {
state.pushActiveContextObject(state.getRootContextObject());
arguments[i] = children[i].getValueInternal(state).getValue();
} finally {
state.popActiveContextObject();
}
}
if (currentContext.getValue() == null) {
if (nullSafe) {