--- old/test/jdk/java/util/concurrent/tck/ConcurrentHashMapTest.java 2018-11-28 15:07:57.249329371 -0800 +++ new/test/jdk/java/util/concurrent/tck/ConcurrentHashMapTest.java 2018-11-28 15:07:56.941329464 -0800 @@ -865,4 +865,20 @@ assertEquals(mapSize, map.size()); } + public void testReentrantComputeIfAbsent() { + ConcurrentHashMap map = new ConcurrentHashMap<>(16); + try { + for (int i = 0; i < 100; i++) { // force a resize + map.computeIfAbsent(i, key -> findValue(map, key)); + } + fail("recursive computeIfAbsent should throw IllegalStateException"); + } catch (IllegalStateException success) {} + } + + private Integer findValue(ConcurrentHashMap map, + Integer key) { + return (key % 5 == 0) ? key : + map.computeIfAbsent(key + 1, k -> findValue(map, k)); + } + }