391 |
|
final Node[] resizeTable(CustomConcurrentHashMap cchm) { |
392 |
|
Node[] oldTable = table; |
393 |
|
if (oldTable == null) |
394 |
< |
return table = (Node[]) |
395 |
< |
new Node[cchm.initialSegmentCapacity]; |
394 |
> |
return table = new Node[cchm.initialSegmentCapacity]; |
395 |
|
|
396 |
|
int oldCapacity = oldTable.length; |
397 |
|
if (oldCapacity >= MAX_SEGMENT_CAPACITY) |
398 |
|
return oldTable; |
399 |
< |
Node[] newTable = |
401 |
< |
(Node[])new Node[oldCapacity<<1]; |
399 |
> |
Node[] newTable = new Node[oldCapacity<<1]; |
400 |
|
int sizeMask = newTable.length - 1; |
401 |
|
NodeFactory fac = cchm.factory; |
402 |
|
for (int i = 0; i < oldCapacity ; i++) { |
538 |
|
capacity = MAX_SEGMENT_CAPACITY; |
539 |
|
this.initialSegmentCapacity = capacity; |
540 |
|
} |
541 |
< |
this.segments = (Segment[])new Segment[NSEGMENTS]; |
541 |
> |
this.segments = new Segment[NSEGMENTS]; |
542 |
|
} |
543 |
|
|
544 |
|
/** |
1574 |
|
private void readObject(java.io.ObjectInputStream s) |
1575 |
|
throws IOException, ClassNotFoundException { |
1576 |
|
s.defaultReadObject(); |
1577 |
< |
this.segments = (Segment[])(new Segment[NSEGMENTS]); |
1577 |
> |
this.segments = new Segment[NSEGMENTS]; |
1578 |
|
for (;;) { |
1579 |
|
K key = (K) s.readObject(); |
1580 |
|
V value = (V) s.readObject(); |