el-spec icon indicating copy to clipboard operation
el-spec copied to clipboard

Make it possible to use javax.el.LambdaExpression in place of java se 8 functional interfaces

Open glassfishrobot opened this issue 11 years ago • 4 comments

Since EL Lambdas predate Java functional interfaces, custom EL resolvers must be used to as bridge between javax.el.LambdaExpression, and actual method with a accepting functional interface parameter.

Java EE 8 revision of EL should either

  1. bring sufficient support for all Java SE methods accepting functional interfaces, or
  2. offer implicit type conversion from LambdaExpression to appropriate types defined in java.util.function, or
  3. offer implicit conversion to any Functional interface conforming to §9.8 of JLS.

Example implementation of the first approach for java.util.Optional can be seen here

glassfishrobot avatar Dec 06 '14 13:12 glassfishrobot

Reported by pdudits

glassfishrobot avatar Dec 06 '14 13:12 glassfishrobot

kchung said: Again, this is in the plan for EL 3.1.

It would be straight forward to support the conversions to all the known functions in java.util.functions, approach 2 above, but it will be difficult to support general functional interfaces, since it involves calling methods with Lambda expressions as arguments in reflection, which is hard to get right. So approach 3 is unlikely to be supported in EL 3.1.

glassfishrobot avatar Dec 11 '14 17:12 glassfishrobot

Was assigned to kchung

glassfishrobot avatar Dec 06 '14 13:12 glassfishrobot

This issue was imported from java.net JIRA EL_SPEC-22

glassfishrobot avatar Apr 24 '17 07:04 glassfishrobot