Modern Java Recipes

Errata for Modern Java Recipes

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Safari Books Online
Examples 9.23 and 9.24

In examples 9.23 and 9.24, join() is called on the CompletableFuture before printing Running... As join is a blocking call, the message is printed after the future completed instead of after it started.

Note from the Author or Editor:
After Example 9-23, following the bullet list, the text current reads "The output is 'Running...' followed by 84". That should be, "Because the call to <code>join</code> is a blocking call, the output is 84 followed by 'Running'."

David Paccoud  Sep 07, 2017 
Safari Books Online
Examples 9.23 and 9.24

In examples 9.23 and 9.24 CompletableFuture.supplyAsync(() -> this::sleepThenReturnString) should read CompletableFuture.supplyAsync(this::sleepThenReturnString)

Note from the Author or Editor:
Yes, thanks for the correction. We need to drop the "() ->" exactly as you stated in both examples. The second one is no doubt a copy-and-paste error from the first. Fortunately both are correct in the GitHub repo with the source code.

David Paccoud  Sep 07, 2017 
PDF
Page 32
Example 2-6

Method of Predicate class shown as isEquals. Should read isEqual without last s.

Note from the Author or Editor:
Method should be "isEqual" without a trailing "s"

Campbell Ritchie  Sep 18, 2017 
Printed
Page 37
Table 2-3

The single abstract method for BiFunction is incorrect in the table It should be: R apply(T t, U u)

Note from the Author or Editor:
Yes, it's a typo. The signature in the book starts with "void" and it should be "R", exactly as the error stated.

Chris Davidson  Sep 05, 2017 
PDF
Page 42
Right in the middle

It says "Their method signatures from IntStream are (LongStream is similar) . . ." but shows LongStream methods too. Would read better as "Their method signatures from IntStream and LongStream are . . . "

Note from the Author or Editor:
The text should say "the methods from IntStream and LongStream are"

Campbell Ritchie  Sep 18, 2017 
PDF
Page 44
Very bottom

It says Integer constructor is used but shows valueOf in the preceding example.

Note from the Author or Editor:
Instead of "uses the Integer constructor", should say "uses the static valueOf method from the Integer class"

Campbell Ritchie  Sep 18, 2017 
PDF
Page 66
End of 4-6

This sentence does not parse: "Each returns a sequential, ordered stream that starts and the first argument and increments by one after that." I believe you mean: "Each returns a sequential, ordered stream that starts on the first argument and increments by one after that."

eldavojohn  Apr 03, 2017  Aug 04, 2017