1213 |
|
*/ |
1214 |
|
public KeySetView<K,V> keySet() { |
1215 |
|
KeySetView<K,V> ks; |
1216 |
< |
return (ks = keySet) != null ? ks : (keySet = new KeySetView<K,V>(this, null)); |
1216 |
> |
if ((ks = keySet) != null) return ks; |
1217 |
> |
return keySet = new KeySetView<K,V>(this, null); |
1218 |
|
} |
1219 |
|
|
1220 |
|
/** |
1237 |
|
*/ |
1238 |
|
public Collection<V> values() { |
1239 |
|
ValuesView<K,V> vs; |
1240 |
< |
return (vs = values) != null ? vs : (values = new ValuesView<K,V>(this)); |
1240 |
> |
if ((vs = values) != null) return vs; |
1241 |
> |
return values = new ValuesView<K,V>(this); |
1242 |
|
} |
1243 |
|
|
1244 |
|
/** |
1260 |
|
*/ |
1261 |
|
public Set<Map.Entry<K,V>> entrySet() { |
1262 |
|
EntrySetView<K,V> es; |
1263 |
< |
return (es = entrySet) != null ? es : (entrySet = new EntrySetView<K,V>(this)); |
1263 |
> |
if ((es = entrySet) != null) return es; |
1264 |
> |
return entrySet = new EntrySetView<K,V>(this); |
1265 |
|
} |
1266 |
|
|
1267 |
|
/** |
2520 |
|
setTabAt(tab, i, fwd); |
2521 |
|
advance = true; |
2522 |
|
} |
2523 |
+ |
else if (f instanceof ReservationNode) |
2524 |
+ |
throw new IllegalStateException("Recursive update"); |
2525 |
|
} |
2526 |
|
} |
2527 |
|
} |
2534 |
|
* A padded cell for distributing counts. Adapted from LongAdder |
2535 |
|
* and Striped64. See their internal docs for explanation. |
2536 |
|
*/ |
2537 |
< |
@jdk.internal.vm.annotation.Contended static final class CounterCell { |
2537 |
> |
@sun.misc.Contended static final class CounterCell { |
2538 |
|
volatile long value; |
2539 |
|
CounterCell(long x) { value = x; } |
2540 |
|
} |
3434 |
|
|
3435 |
|
static final class KeyIterator<K,V> extends BaseIterator<K,V> |
3436 |
|
implements Iterator<K>, Enumeration<K> { |
3437 |
< |
KeyIterator(Node<K,V>[] tab, int index, int size, int limit, |
3437 |
> |
KeyIterator(Node<K,V>[] tab, int size, int index, int limit, |
3438 |
|
ConcurrentHashMap<K,V> map) { |
3439 |
< |
super(tab, index, size, limit, map); |
3439 |
> |
super(tab, size, index, limit, map); |
3440 |
|
} |
3441 |
|
|
3442 |
|
public final K next() { |
3454 |
|
|
3455 |
|
static final class ValueIterator<K,V> extends BaseIterator<K,V> |
3456 |
|
implements Iterator<V>, Enumeration<V> { |
3457 |
< |
ValueIterator(Node<K,V>[] tab, int index, int size, int limit, |
3457 |
> |
ValueIterator(Node<K,V>[] tab, int size, int index, int limit, |
3458 |
|
ConcurrentHashMap<K,V> map) { |
3459 |
< |
super(tab, index, size, limit, map); |
3459 |
> |
super(tab, size, index, limit, map); |
3460 |
|
} |
3461 |
|
|
3462 |
|
public final V next() { |
3474 |
|
|
3475 |
|
static final class EntryIterator<K,V> extends BaseIterator<K,V> |
3476 |
|
implements Iterator<Map.Entry<K,V>> { |
3477 |
< |
EntryIterator(Node<K,V>[] tab, int index, int size, int limit, |
3477 |
> |
EntryIterator(Node<K,V>[] tab, int size, int index, int limit, |
3478 |
|
ConcurrentHashMap<K,V> map) { |
3479 |
< |
super(tab, index, size, limit, map); |
3479 |
> |
super(tab, size, index, limit, map); |
3480 |
|
} |
3481 |
|
|
3482 |
|
public final Map.Entry<K,V> next() { |