Susan Harkins (406) [Avatar] Offline
Please post errors in the published version of Modern Java in Action here. If necessary, we'll publish a comprehensive list for everyone's convenience.
Thank you for participating in the collection process. Your contributions are a great help to us and other readers.


Susan Harkins
Errata Editor
572564 (1) [Avatar] Offline
Cap. 1

This instruction
 filterApples(inventory, Apple::isGreenApple);
doesn’t work in the FilteringApples class. As well the second one
 filterApples(inventory, Apple::isHeavyApple);

Everything is fine.

On the code downloaded by the site is used a class named FilteringApples. We have to create an Apple class from scratch that will be non static nested, and to follow the book.

Thanks and sorry for the inconvenience.
Irina Marudina (3) [Avatar] Offline
Formatting issue in 2.4.1 - missing indentation. Spotted in pdf & liveBook:

inventory.sort(new Comparator<Apple>() {
public int compare(Apple a1, Apple a2) {
return a1.getWeight().compareTo(a2.getWeight());
Irina Marudina (3) [Avatar] Offline
Possible highlighting issue in Fig. 3.3

Step 3 in the table highlights only the following:
processFile(BufferedReaderProcessof p)

In chapter 3.3.3. the step is named "Step 3: Execute a behavior!"

Shouldn't there be a highlight on the following line in Fig 3.3 too?

In chapter 3.3.3 this line has a note attached which also points that it is an important one.
Irina Marudina (3) [Avatar] Offline
Missing arrow in lambda example in chapter 3.6, p. 65:

inventory.sort((Apple a1, Apple a2)
440639 (1) [Avatar] Offline
Errata in Modern Java in Action : Chapter 15, Section 15.1.2
In the subsection entitled " THREAD POOLS AND WHY THEY ARE BAD", in the sentence:

“One great outcome is that it’s cheap to submit thousands of tasks to a thread pool while keeping the number of tasks threads to a hardware-appropriate number.”

Should the second tasks be replaced by threads ?
bruno_bravo (10) [Avatar] Offline
Section 15.1 - Page 362 - Footnote 2
Footnote says: "We’d use the word core here"

Actually, the word "core" was not used in the phrase referenced by the footnote. It was used the expression ‘hardware threads’ which is not the same as cores. Some processors use two hardware threads in each processor core.

Kapil Dev S (2) [Avatar] Offline
Page 93, Quiz 4.1 Answer is, we have to use filter and map pattern. map is missed in the answer.
Michal Fotyga (1) [Avatar] Offline
liveBook version, chapter 16.3.4. Using a custom Executor, section Parallelism: via Streams or CompletableFutures?
There is: "wait/computer" written but I think it should be "wait/compute" (the same way as it was used earlier)
Krisztián Nagy (1) [Avatar] Offline
Errata in Modern Java in Action : Chapter 14, Section 14.5.1

Problem: In the directory structure the file and the http directories are displayed on the same level as the readers.

The example show 3 packages where the readers directory contains the file and http:
exports com.example.expenses.readers;
exports com.example.expenses.readers.file;
exports com.example.expenses.readers.http;

The same problem can be found in 14.6