ValueExpression valueExpressionWrapper;
// JUEL older than 2.2.6 had the expectation that the value expression only wraps a Method instance that can be statically called.
if (Hacks.isJUELUsed(ctx.getExpressionFactory()) && !Hacks.isJUELSupportingMethodExpression()) {
valueExpressionWrapper = new ValueExpressionMethodWrapper(methodExpression);
} else {
// Sun/Apache EL and JUEL 2.2.6 and higher can call a method expression wrapped in a value expression.
valueExpressionWrapper = ctx.getExpressionFactory().createValueExpression(methodExpression, MethodExpression.class);
}