A DESCRIPTION OF THE PROBLEM :
The description of both ConcurrentMap.computeIfAbsent and Map.computeIfAbsent state that the return value is the current (existing or computed) value mapped for the given key.
However, the "equivalent code" snippet in the Implementation Requirements section:
if (map.get(key) == null) {
V newValue = mappingFunction.apply(key);
if (newValue != null)
return map.putIfAbsent(key, newValue);
}
Shows it returning the result of putIfAbsent(), which is defined to return the previous mapping, or null if none existed.
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html#computeIfAbsent-K-java.util.function.Function-