From 53beadb7bfdd924401088094b59d384fdeb074a7 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Fri, 15 Sep 2006 03:27:26 +0000 Subject: [PATCH] SEC-290: Correct bug with generation of SimpleMethodInvocation. --- .../acegisecurity/util/MethodInvocationUtils.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/util/MethodInvocationUtils.java b/core/src/main/java/org/acegisecurity/util/MethodInvocationUtils.java index b4e4883f6f..f43d76ec3f 100644 --- a/core/src/main/java/org/acegisecurity/util/MethodInvocationUtils.java +++ b/core/src/main/java/org/acegisecurity/util/MethodInvocationUtils.java @@ -72,7 +72,7 @@ public class MethodInvocationUtils { classArgs = (Class[]) list.toArray(new Class[] {}); } - return createFromClass(object.getClass(), methodName, classArgs); + return createFromClass(object.getClass(), methodName, classArgs, args); } /** @@ -84,7 +84,7 @@ public class MethodInvocationUtils { * @return a MethodInvocation, or null if there was a problem */ public static MethodInvocation createFromClass(Class clazz, String methodName) { - return createFromClass(clazz, methodName, null); + return createFromClass(clazz, methodName, null, null); } /** @@ -93,18 +93,18 @@ public class MethodInvocationUtils { * * @param clazz the class of object that will be used to find the relevant Method * @param methodName the name of the method to find - * @param args arguments that are required as part of the method signature - * + * @param classArgs arguments that are required to locate the relevant method signature + * @param args the actual arguments that should be passed to SimpleMethodInvocation * @return a MethodInvocation, or null if there was a problem */ - public static MethodInvocation createFromClass(Class clazz, String methodName, Class[] args) { + public static MethodInvocation createFromClass(Class clazz, String methodName, Class[] classArgs, Object[] args) { Assert.notNull(clazz, "Class required"); Assert.hasText(methodName, "MethodName required"); Method method; try { - method = clazz.getMethod(methodName, args); + method = clazz.getMethod(methodName, classArgs); } catch (Exception e) { return null; }