Functional Programming in Java, Second Edition: Chapter 10 nitpicking

On page 174:


Should probably be

Stream API

Also on page 174:

blow up with an exception

Suggesting to change this wherever it occurs. This is really an unfortunate choice of words. We raise or throw an exception. “Blowing up” really suggest uncontrolled trundling maybe leading to process termination, as happens in a segmentation fault. After all, an exception is just a managed way of transferring control and dumping no-longer useful data structures overboard.

On page 175

If the version of Java you’re using supports sealed classes

This is:

One should indicate “since Java 17, September 2021”


Is the work “functional pipeline” the correct terminology? The official word is “stream pipline” apparently:

To perform a computation, stream operations are composed into a stream pipeline. A stream pipeline consists of a source (which might be an array, a collection, a generator function, an I/O channel, etc), zero or more intermediate operations (which transform a stream into another stream, such as filter(Predicate) and a terminal operation (which produces a result or side-effect, such as count() or forEach(Consumer). Streams are lazy; computation on the source data is only performed when the terminal operation is initiated, and source elements are consumed only as needed.

Fixed. Thank you.

1 Like