By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
33 | ERROR | Hi, the code returning the sum of total number of characters does not work. System.out.println(“Total number of characters in all names: ” + Cheers Mark | 2013-06-16 | ||
56 | ERROR | public static int totalAssetValues(final List does not compile but using mapToInt does as in : public static int totalAssetValues(final List | 2013-06-16 | ||
66 | SUGGEST | Hello, Thx again for the wonderful work :) In the filters example when reducing or else to color -> color, a generic identity function like public final class Functions { could be used. Using inference(I guess!)m the filter reduction would look like filter = Arrays.asList(filters).stream() Cheers Mark | 2013-06-16 | ||
97 | TYPO | “We will first mark this method synthesized…” instead of “We will first mark this method synchronized…” | 2013-06-16 | ||
106 | ERROR | Method “Stream.intRange” does not seem to exists. Apparently it is now “IntStream.range” Cheers | 2013-06-16 | ||
107 | ERROR | The method Streams.iterate seems to exist not anymore. But Stream.iterate fulfills the exercise purpose. cheers | 2013-06-16 | ||
114 | ERROR | The method Streams.iterate seems to exist not anymore. But Stream.iterate fulfills the exercise purpose. | 2013-06-16 | ||
xiii | TYPO | In Chapter 7, Optimizing Recursions, on page 111 we will use lambda expressions to optimize recursions and achieve stellar performance using memoization techniques. | 2013-07-10 | Sorry if I am missing something totally here, I do not see the typo (memoization is the right spelling for this term). | |
3 | ERROR | I think there is no sum() on the Stream in the version of the JDK8 build 1.8.0-ea-b96. Here is the compilation error I get: DiscountFunctional.java:22: error: cannot find symbol I understand that you have used an earlier version that might have had the sum() method. Just wanted to report it. | 2013-07-05 | ||
53 | TYPO | I think WatchService was introduced in Java 7. (docs.oracle.com/javase/7/docs/api/java/nio/file/WatchService.html) The section 3.6 has a reference to Java 6 - “Here we’ll explore the facility already available since Java 6, the WatchService to watch for file change.” There is also one more sentence in page # 54 - “We see an interplay of a Java 6 feature and the Java 8 features here.” | 2013-07-10 | ||
44 | ERROR | In the epub version on pages 44 through 49 of 558, double is used for prices. This code will not always work correctly. Either the data type should be changed to something else (such as a BigDecimal) or an epsilon value is needed for the comparison. I tried to include a link but it was not allowed. Try googling | 2013-11-28 | ||
39 | ERROR | SUMMARY: DETAILS: | 2013-08-19 | Hi Nils, could you please check to make sure you're using the lambda-8 build of Java 8. The URL for that is given in the book. Thanks. Venkat | |
296 | TYPO | The terminal method, send in this example, wraped up the sequence. | 2013-08-02 | ||
327 | TYPO | UseInstance is a functional interface, an ideal candidate for the Java complier to | 2013-08-02 | ||
n/a | n/a | TYPO | Just before section 2.2: “but for now let’s >>>reflection<<< on the wise words of Antoine de Saint-Exupery” | 2013-08-30 | |
n/a | n/a | SUGGEST | In 2.4 Reusing Lambda Expressions, consider using .count() instead of .toArray().length() | 2013-09-13 | |
110 | TYPO | “In contract, the range method,” makes no sense. Propably | 2013-11-26 | ||
13 | TYPO | Programmers mostly interested in other JVM languages like Scala, Groovy, JRuby, and Closure … Closure should be ‘Clojure’ instead. | 2013-12-15 | ||
59 | TYPO | “filesInCurerentDir” in example “compare/fpij/ListSubDirs.java” should be “filesInCurrentDir” | 2014-01-15 | ||
19 | ERROR | the beginning of ch 2 states that Arrays.asList creates an immutable list. It does not. The list is fixed-size, but not fixed-contents. You can call “set” on the list to change the contents at an index. | |||
34 | SUGGEST | Following code is not a good example: System.out.println(String.format(“A name starting with %s: %s”, The code should use printf instead of println with String.format. | |||
23 | SUGGEST | I think it is better to use the diamond operator as much as possible. For example: final List This should be: final List | |||
382 | ERROR | This code: Won’t work as expected. It will print out the int value for each character. The code to make it print out correctly would be. str.chars() This will print the char value as a char. | |||
0 | TYPO | I presume you folks have noticed that the spine of the printed book says: “Functional Pgrogramming in Java”? Admittedly, I often feel like I am p-grog-ramming when I’m trying to understand Lambdas, but you might want to go with the more conservative spelling for the next print run :-) phillip.hutto@gmail.com | |||
74 | ERROR | In page 74 Designing Filters [[ This is the andThen () method, not compose () | |||
74 | ERROR | I expected the filters to be applied in left-to-right order but it’s the other way around. | |||
182 | SUGGEST | Since we are into removing code noise, this: and this: should be refactorized like this, to stand a fair comparison: System.out.println(foundName != null ? foundName : “No name found”); | |||
107 | ERROR | Lazy initialization with Holder class. This approach has the same problem why double checked locking fails. Potentially a thread can see a half-created HeavyFactory supplier when calling the getHeavy() method. Making the private Supplier field volatile might fix the problem. | |||
68 | TYPO | Let quickly run these last three calls should be Let’s quickly run… | |||
24 | ERROR | You say in the next to last paragraph that “the map() method collects the result of running the lambda expression and returns the result collection.” It actually returns a Stream | |||
39 | ERROR | In PrintList.java it is: .collect(joining(“, ”))); , but must be: .collect(Collectors.joining(“, ”)); | |||
89 | ERROR | If I have understood right example “wrapper = target.compose(next);” isn’t really same as “temp = target.apply(input); since compose means that argument is executed first “default Again, if I have understood right everything would be as explained if there would be “andThen” in use instead of “compose” “default I might mix things, but this is how I interpret use of static method for chaining from java 8 api documentation. | |||
76 | ERROR | You write “… first it passes through the bright filter, which brightens the shades, then it goes through the dark filter …”. As far as I read the code: .reduce( (filter, next) -> filter.compose(next)) then the next filter will be applied first. So it’s actually the dark filter that is applied first and then the bright filter. From the Function javadoc: | |||
safri | TYPO | A Peek into the default Methods | |||
74 | ERROR | The order of compose is the other way around. | |||
71 | ERROR | In YahooFinance.java the line : | |||
131 | ERROR | The code for RodCutterMemoized builds correctly on my computer, but at runtime an exception is raised in Memoizer.java at line : The error message is this : | |||
Many | SUGGEST | ‘concision’ is more concise than ‘conciseness’ | |||
133 | ERROR | As it was reported by somebody else the code for RodCutterMemoized does not work on Java 14 where it throws java.util.ConcurrentModificationException error. To fix this problem one has to replace line return store.computeIfAbsent(input, key -> function.apply(this, key)); in Memoizer.java with R value = function.apply(this, input); | |||
56 | ERROR | CloseableStream does not exist in the JDK. Streams might implement the Closeable interface, but there is no CloseableStream class. | |||
131 | ERROR | Regarding the RodCutterMemoized Concurrency issue mentioned in #84133 and #86676: For anyone trying the suggested quick fix in #86676: Of course it also requires a check for existing Keys, otherwise there is no memoisation feature. One way of doing it: In Memoizer.java replace the line: With those 2 lines: Hope it helps. |