|
This post originated from an RSS feed registered with Java Buzz
by justin cater.
|
Original Post: Puzzler: nested computeIfAbsent
Feed Title: Java Code Geeks
Feed URL: http://feeds.feedburner.com/JavaCodeGeeks
Feed Description: Java 2 Java Developers Resource Center
|
Latest Java Buzz Posts
Latest Java Buzz Posts by justin cater
Latest Posts From Java Code Geeks
|
|
Overview The Java 8 libraries have a new method on map, computeIfAbsent. This is very useful way to turn your Map into a cache of objects associated with a key. However, there is a combination you might not have considered; what happens if you call computeIfAbsent inside itself. map.computeIfAbsent(Key.Hello, s -> { map.computeIfAbsent(Key.Hello, t -> ...
Read: Puzzler: nested computeIfAbsent