1525 |
|
|
1526 |
|
// Support for resetting lock while deserializing |
1527 |
|
private void resetLock() { |
1528 |
– |
U.putObjectVolatile(this, LOCK, new Object()); |
1529 |
– |
} |
1530 |
– |
private static final jdk.internal.misc.Unsafe U = jdk.internal.misc.Unsafe.getUnsafe(); |
1531 |
– |
private static final long LOCK; |
1532 |
– |
static { |
1528 |
|
try { |
1529 |
< |
LOCK = U.objectFieldOffset |
1530 |
< |
(CopyOnWriteArrayList.class.getDeclaredField("lock")); |
1529 |
> |
java.lang.reflect.Field f = |
1530 |
> |
CopyOnWriteArrayList.class.getDeclaredField("lock"); |
1531 |
> |
f.setAccessible(true); |
1532 |
> |
f.set(this, new Object()); |
1533 |
|
} catch (ReflectiveOperationException e) { |
1534 |
|
throw new Error(e); |
1535 |
|
} |