You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aritz Maeztu <am...@tesicnor.com> on 2016/08/24 06:43:17 UTC

Fwd: Fwd: EL Stream API differing from the Java one

I've already posted the issue in StackOverflow: 
http://stackoverflow.com/questions/39096941/does-tomcats-el-stream-api-make-sense

Using Tomcat 8.0.30, I've implemented some EL accesses to the stream 
API. However, I've found that this expression:

|#{testBean.values.stream().anyMatch(str ->str == 'Test1')} Returns a ||org.apache.el.stream.Optional type. Looking at the API documentation it 
also says that. However, in the standard Java Stream API this kind of 
method returns a boolean, which is the result of evaluating the 
Predicate and see if any object in the stream matches it.|


-- 
Aritz Maeztu Otao
Departamento Desarrollo de Software 
<https://www.linkedin.com/in/aritz-maeztu-ota%C3%B1o-65891942>
<http://www.tesicnor.com> 	

Pol. Ind. Mocholi. C/Rio Elorz, Nave 13E 31110 Noain (Navarra)
Telf. Aritz Maeztu: 948 68 03 06
Telf. Secretara: 948 21 40 40

Antes de imprimir este e-mail piense bien si es necesario hacerlo: El 
medioambiente es cosa de todos.


Re: Fwd: Fwd: EL Stream API differing from the Java one

Posted by Mark Thomas <ma...@apache.org>.
On 24/08/2016 07:43, Aritz Maeztu wrote:
> I've already posted the issue in StackOverflow:
> http://stackoverflow.com/questions/39096941/does-tomcats-el-stream-api-make-sense
> 
> Using Tomcat 8.0.30, I've implemented some EL accesses to the stream
> API. However, I've found that this expression:
> 
> |#{testBean.values.stream().anyMatch(str ->str == 'Test1')} Returns a ||org.apache.el.stream.Optional type. Looking at the API documentation it
> also says that.   However, in the standard Java Stream API this kind of
> method returns a boolean, which is the result of evaluating the
> Predicate and see if any object in the stream matches it.|

Yes, the EL 3.0 Stream API is not identical to the Java 8 Stream API.
This is because the EL 3.0 Stream API was finalized before the Java 8
API. As a result, there are some differences. This is one of them.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org