28 |
|
class Implementation implements MapImplementation { |
29 |
|
public Class<?> klazz() { return ConcurrentHashMap.class; } |
30 |
|
public Map emptyMap() { return new ConcurrentHashMap(); } |
31 |
– |
public Object makeKey(int i) { return i; } |
32 |
– |
public Object makeValue(int i) { return i; } |
31 |
|
public boolean isConcurrent() { return true; } |
32 |
|
public boolean permitsNullKeys() { return false; } |
33 |
|
public boolean permitsNullValues() { return false; } |
842 |
|
for (int i = 0; i < 100; i++) { // force a resize |
843 |
|
map.computeIfAbsent(i, key -> findValue(map, key)); |
844 |
|
} |
845 |
< |
fail("recursive computeIfAbsent"); |
846 |
< |
} catch (IllegalStateException ex) { |
849 |
< |
} |
845 |
> |
fail("recursive computeIfAbsent should throw IllegalStateException"); |
846 |
> |
} catch (IllegalStateException success) {} |
847 |
|
} |
848 |
|
|
849 |
|
private Integer findValue(ConcurrentHashMap<Integer, Integer> map, |