249 |
|
|
250 |
|
/* Specialized implementations of map methods */ |
251 |
|
|
252 |
< |
V get(K key, int hash) { |
252 |
> |
V get(Object key, int hash) { |
253 |
|
if (count != 0) { // read-volatile |
254 |
|
HashEntry[] tab = table; |
255 |
|
int index = hash & (tab.length - 1); |
332 |
|
* offset. We eliminate unnecessary node creation by catching |
333 |
|
* cases where old nodes can be reused because their next |
334 |
|
* fields won't change. Statistically, at the default |
335 |
< |
* threshhold, only about one-sixth of them need cloning when |
335 |
> |
* threshold, only about one-sixth of them need cloning when |
336 |
|
* a table doubles. The nodes they replace will be garbage |
337 |
|
* collectable as soon as they are no longer referenced by any |
338 |
|
* reader thread that may be in the midst of traversing table |
408 |
|
return null; |
409 |
|
|
410 |
|
// All entries following removed node can stay in list, but |
411 |
< |
// all preceeding ones need to be cloned. |
411 |
> |
// all preceding ones need to be cloned. |
412 |
|
HashEntry<K,V> newFirst = e.next; |
413 |
|
for (HashEntry<K,V> p = first; p != e; p = p.next) |
414 |
|
newFirst = new HashEntry<K,V>(p.hash, p.key, |
642 |
|
*/ |
643 |
|
public V get(Object key) { |
644 |
|
int hash = hash(key); // throws NullPointerException if key null |
645 |
< |
return segmentFor(hash).get((K) key, hash); |
645 |
> |
return segmentFor(hash).get(key, hash); |
646 |
|
} |
647 |
|
|
648 |
|
/** |