199 |
|
static { |
200 |
|
try { |
201 |
|
UNSAFE = sun.misc.Unsafe.getUnsafe(); |
202 |
< |
Class k = HashEntry.class; |
202 |
> |
Class<?> k = HashEntry.class; |
203 |
|
nextOffset = UNSAFE.objectFieldOffset |
204 |
|
(k.getDeclaredField("next")); |
205 |
|
} catch (Exception e) { |
404 |
|
int newCapacity = oldCapacity << 1; |
405 |
|
threshold = (int)(newCapacity * loadFactor); |
406 |
|
HashEntry<K,V>[] newTable = |
407 |
< |
(HashEntry<K,V>[]) new HashEntry[newCapacity]; |
407 |
> |
(HashEntry<K,V>[]) new HashEntry<?,?>[newCapacity]; |
408 |
|
int sizeMask = newCapacity - 1; |
409 |
|
for (int i = 0; i < oldCapacity ; i++) { |
410 |
|
HashEntry<K,V> e = oldTable[i]; |
648 |
|
int cap = proto.table.length; |
649 |
|
float lf = proto.loadFactor; |
650 |
|
int threshold = (int)(cap * lf); |
651 |
< |
HashEntry<K,V>[] tab = (HashEntry<K,V>[])new HashEntry[cap]; |
651 |
> |
HashEntry<K,V>[] tab = (HashEntry<K,V>[])new HashEntry<?,?>[cap]; |
652 |
|
if ((seg = (Segment<K,V>)UNSAFE.getObjectVolatile(ss, u)) |
653 |
|
== null) { // recheck |
654 |
|
Segment<K,V> s = new Segment<K,V>(lf, threshold, tab); |
729 |
|
// create segments and segments[0] |
730 |
|
Segment<K,V> s0 = |
731 |
|
new Segment<K,V>(loadFactor, (int)(cap * loadFactor), |
732 |
< |
(HashEntry<K,V>[])new HashEntry[cap]); |
733 |
< |
Segment<K,V>[] ss = (Segment<K,V>[])new Segment[ssize]; |
732 |
> |
(HashEntry<K,V>[])new HashEntry<?,?>[cap]); |
733 |
> |
Segment<K,V>[] ss = (Segment<K,V>[])new Segment<?,?>[ssize]; |
734 |
|
UNSAFE.putOrderedObject(ss, SBASE, s0); // ordered write of segments[0] |
735 |
|
this.segments = ss; |
736 |
|
} |
1441 |
|
Segment<K,V> seg = segments[k]; |
1442 |
|
if (seg != null) { |
1443 |
|
seg.threshold = (int)(cap * seg.loadFactor); |
1444 |
< |
seg.table = (HashEntry<K,V>[]) new HashEntry[cap]; |
1444 |
> |
seg.table = (HashEntry<K,V>[]) new HashEntry<?,?>[cap]; |
1445 |
|
} |
1446 |
|
} |
1447 |
|
|
1466 |
|
int ss, ts; |
1467 |
|
try { |
1468 |
|
UNSAFE = sun.misc.Unsafe.getUnsafe(); |
1469 |
< |
Class tc = HashEntry[].class; |
1470 |
< |
Class sc = Segment[].class; |
1469 |
> |
Class<?> tc = HashEntry[].class; |
1470 |
> |
Class<?> sc = Segment[].class; |
1471 |
|
TBASE = UNSAFE.arrayBaseOffset(tc); |
1472 |
|
SBASE = UNSAFE.arrayBaseOffset(sc); |
1473 |
|
ts = UNSAFE.arrayIndexScale(tc); |