In method AstFunction#getValue, the vargargs values are resolved and added to named varargs variable. The varargs variables is never added to the parameter list used to call the method. if (inputParameterCount > 0) { params = new Object[methodParameterCount]; try { for (int i = 0; i < methodParameterCount; i++) { if (m.isVarArgs() && i == methodParameterCount - 1) { if (inputParameterCount < methodParameterCount) { params[i] = null; } else { Object[] varargs = new Object[inputParameterCount - methodParameterCount + 1]; Class<?> target = paramTypes[i].getComponentType(); for (int j = i; j < inputParameterCount; j++) { varargs[j-i] = parameters.jjtGetChild(j).getValue(ctx); varargs[j-i] = coerceToType(ctx, varargs[j-i], target); } } } else { params[i] = parameters.jjtGetChild(i).getValue(ctx); params[i] = coerceToType(ctx, params[i], paramTypes[i]); } } } catch (ELException ele) { throw new ELException(MessageFactory.get("error.function", this .getOutputName()), ele); } } try { result = m.invoke(null, params); } catch (IllegalAccessException iae) { throw new ELException(MessageFactory.get("error.function", this .getOutputName()), iae); } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof ThreadDeath) { throw (ThreadDeath) cause; } if (cause instanceof VirtualMachineError) { throw (VirtualMachineError) cause; } throw new ELException(MessageFactory.get("error.function", this .getOutputName()), cause); } return result;
This has been fixed in the following branches: - 9.0.x for 9.0.0.M10 onwards - 8.5.x for 8.5.5 onwards - 8.0.x for 8.0.37 onwards