(ELContext context, Class<?> clazz, Object base, String methodName, Class<?>[] paramTypes,
Object[] paramValues)
| 90 | * This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync. |
| 91 | */ |
| 92 | static Method findMethod(ELContext context, Class<?> clazz, Object base, String methodName, Class<?>[] paramTypes, |
| 93 | Object[] paramValues) { |
| 94 | |
| 95 | if (clazz == null || methodName == null) { |
| 96 | throw new MethodNotFoundException( |
| 97 | message(null, "util.method.notfound", clazz, methodName, paramString(paramTypes))); |
| 98 | } |
| 99 | |
| 100 | if (paramTypes == null) { |
| 101 | paramTypes = getTypesFromValues(paramValues); |
| 102 | } |
| 103 | |
| 104 | // Fast path: when no arguments exist, there can only be one matching method and no need for coercion. |
| 105 | if (paramTypes.length == 0) { |
| 106 | try { |
| 107 | Method method = clazz.getMethod(methodName, paramTypes); |
| 108 | return getMethod(clazz, base, method); |
| 109 | } catch (NoSuchMethodException | SecurityException ignore) { |
| 110 | // Fall through to broader, slower logic |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | Method[] methods = clazz.getMethods(); |
| 115 | |
| 116 | List<Wrapper<Method>> wrappers = Wrapper.wrap(methods, methodName); |
| 117 | |
| 118 | Wrapper<Method> result = findWrapper(context, clazz, wrappers, methodName, paramTypes, paramValues); |
| 119 | |
| 120 | return getMethod(clazz, base, result.unWrap()); |
| 121 | } |
| 122 | |
| 123 | /* |
| 124 | * This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync. |
no test coverage detected