Start any video training course for FREE. More than 500 to choose from. Learn more
Java 8 Lambdas

Errata for Java 8 Lambdas

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
Page -1
Code on Github

In class Artist the method isFrom() is: public boolean isFrom(String nationality) { return nationality.equals(nationality); } but should be: public boolean isFrom(String nationality) { return nationality.equals(this.nationality); }

Note from the Author or Editor:
It looks like this is a valid errata report. Thanks for submitting the issue.

Stig Jacobsen  Nov 02, 2014 
Other Digital Version
Location 149 (Kindle), 8th paragraph of chapter 1

O bought the book at Amazon Kindle Store and this version has not page numbers. The issue is minimal, it is a little typo for the word 'readbility', where it should be readability.

Note from the Author or Editor:
Thanks for spotting this issue - I will have the typo fixed.

Michel Graciano  Apr 08, 2014 
Page 14
Exercise 2b

The solution provided for this exercise doesn't compile for me. File is located in the code download at this path: src/test/java/com/insightfullogic/java8/answers/chapter2/ Line with error: String formatted = Question2.formatter.get().format(new Date(0)); Error as follows: Error:(14, 61) java: cannot find symbol symbol: method format(java.util.Date) location: class javax.swing.text.DateFormatter I cannot figure out a possible correction. Thanks

Note from the Author or Editor:
Thanks for letting me know about this issue, and my apologies for it arising in the first place. I foolishly accepted a pull request that changed this example without checking it properly. I've pushed a fix to the github repository.

Patrick Huffer  Sep 01, 2014 
Safari Books Online, Other Digital Version
Page 14
Exercise 2b

Due to timezone considerations the provided test case may fail even if a proper solution is provided (included the one in the answers package). Something along the lines of the following might be better. public void exampleInB() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 1970); cal.set(Calendar.MONTH, Calendar.JANUARY); cal.set(Calendar.DAY_OF_MONTH, 1); String formatted = Question2.formatter.get().format(cal.getTime()); assertEquals("01-Jan-1970", formatted); } }

Note from the Author or Editor:
Valid errata report - I've already fixed and pushed it to the github project with the exercises in.

Russ Moul  Jan 08, 2015 
Page 22
in the middle

It starts by taking a Stream from a List should be It starts by taking a Stream from an Array

Note from the Author or Editor:
Thanks for spotting this - it is a mistaken description.

Randolf Rothfuss  Apr 13, 2014 
Printed, PDF, ePub
Page 38
Exercise5, example code

forEach(musicain -> count.incAndGet();) should be forEach(musicain -> count.incrementAndGet());

Note from the Author or Editor:
Thanks for reporting this error. I've fixed it in my repository and any future update will include a fix for this issue.

Li Hao Su  May 17, 2014 
Page 77
The last paragraph

The original is : Historically, the approach was to use the values method to get a Set of entries and then iterate over them. "the values method" should be "the entrySet method".

Note from the Author or Editor:
This is a valid errata, I've fixed it in the repository.

Justin Lin  Oct 16, 2014 
Page 130
The paragraph before Example 8-37.

The original is : If we want to speed up the time it takes to perform this operation at the expense of using more CPU resources, we can use the parallelStream method without changing any of the other code .... According to Example 8-37, "the parallelStream method" should be "the parallel method".

Note from the Author or Editor:
There are both parallelStream() and parallel() methods which can be used for slightly different purposes. This is a genuine errata item and I've edited the text to refer to both.

Justin Lin  Oct 17, 2014 
Printed, PDF, ePub, Mobi, Safari Books Online
Page 148
(throughout page)

I suspect I may be misunderstanding something here, but I'm wondering if it would be more accurate to replace the following statement: "What this means in the case of Example 9-9 is that we can't start either of the calls to the lookup services until we've logged into both of them" with "What this means in the case of Example 9-9 is that we can't start the second call to the lookup services until we've logged into both of them" That is, it appears to be sufficient to only log into the track service in order to call lookupTracks(). It's only the call to lookupArtists() that's impacted negatively, by virtue of the fact that it occurs second. If this is correct, it would also imply that the left-hand-side of Figure 9-3 is slightly inaccurate.

Note from the Author or Editor:
Hi, Thanks for submitting this issue. You are correct. I've corrected the error in my text and any future editions will contain this fix. Unfortunately I can't correct this issue in people's copies without doing a completely edition release.

Anonymous  Jul 30, 2014