On 09/07/2021 11:40, Konstantin Kolinko wrote:
пт, 9 июл. 2021 г. в 12:19, Mark Thomas <ma...@apache.org>:

On 09/07/2021 09:58, Konstantin Kolinko wrote:

Thanks Konstantin. This is good feedback.

[...]

I wonder how Java itself (a java compiler) deals with coercion of
lambdas to interfaces. Either it generates calls to some helper API,
or it just repeats the same boilerplate code over and over.

I'm not sure. I did look to see if there was anything in the public API
around this I could use to help but didn't find anything.

I found some info:

https://blogs.oracle.com/javamagazine/behind-the-scenes-how-do-lambda-expressions-really-work-in-java
"Behind the scenes: How do lambda expressions really work in Java?"

https://docs.oracle.com/javase/8/docs/api/java/lang/invoke/LambdaMetafactory.html

 From a quick read, it looks like it does not use reflection API, but a
newer invocation API.
I am not sure whether it is useful at this point. Just sharing.

I looked at that but the parsed lambda expression from the EL isn't in the same form as a lambda expression in Java code would be in. You'd need to convert it. You might be able to use something like https://github.com/greenjoe/lambdaFromString to do this conversion.

After looking at things like this for a while, I couldn't see a way to use them to create a solution that was an improvement on the Proxy approach.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to