title: ConcurrentHashMap computeIfAbsent
body: <p>There is a new computeIfAbsent API introduced in Java 8.
  The javadocs for <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#computeIfAbsent-K-java.util.function.Function-" rel="noreferrer">ConcurrentHashMap's impelementation of it</a> state:</p>
  
  <blockquote>
    <p>If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map unless null. The entire method invocation is performed atomically, so the function is applied at most once per key. Some attempted update operations on this map by other threads may be blocked while computation is in progress, so the computation should be short and simple, and must not attempt to update any other mappings of this map.</p>
  </blockquote>
  
  <p>So, what does it say about locking of this implementation in case when the the key already exists and the computation is unneeded? Is the whole method computeIfAbsent synchronized as stated in docs even if no calculation is needed or just the mapping function call is syncronized to prevent calling the function twice?</p>