javadoc small error for Optional.map

Paulo Silveira paulo.silveira at caelum.com.br
Tue Mar 4 12:13:18 PST 2014


We have a simple example for Optional.map:

 Optional<FileInputStream> fis =
         names.stream().filter(name -> !isProcessedYet(name))
                       .findFirst()
                       .map(name -> new FileInputStream(name));

But it would never compile, since FileInputStream::new throws IOException
and Function::apply does not.

--
Paulo Silveira
www.caelum.com.br
www.casadocodigo.com.br
www.alura.com.br


More information about the lambda-dev mailing list