Closed glassfishrobot closed 2 years ago
It is a limitation of the current EL specification.
This would be a new feature for consideration in Jakarta EE 10.
I've been doing some research on this. A generic solution that coerces a LambdaExpression to any functional interface (providing that the types match) looks possible at this point. My plan is to experiment with an implementation in Tomcat and if that is successful add an additional coercion rule to section 1.23 of the EL spec.
(also posted on SO)
This test shows my problem:
It throws:
IllegalArgumentException: Cannot convert javax.el.LambdaExpression@511baa65 of type class javax.el.LambdaExpression to interface java.util.function.Predicate
Is this a bug or limitation of EL 3 or do i miss something?