Fix MethodBasedEvaluationContext.lazyLoadArguments
This commit fix a potential `ArrayIndexOutOfBoundsException` if `lazyLoadArguments` is called with an empty variable argument. See gh-1070
This commit is contained in:
committed by
Stephane Nicoll
parent
dd65689e0a
commit
f075aac7f9
@@ -89,7 +89,7 @@ public class MethodBasedEvaluationContext extends StandardEvaluationContext {
|
||||
String[] parameterNames = this.paramDiscoverer.getParameterNames(this.method);
|
||||
// save parameter names (if discovered)
|
||||
if (parameterNames != null) {
|
||||
for (int i = 0; i < parameterNames.length; i++) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
setVariable(parameterNames[i], this.args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user