1407 |
|
*/ |
1408 |
|
public void testHasWaitersIAE() { |
1409 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1410 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1410 |
> |
final Condition c = lock.writeLock().newCondition(); |
1411 |
|
final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock(); |
1412 |
|
try { |
1413 |
|
lock2.hasWaiters(c); |
1423 |
|
*/ |
1424 |
|
public void testHasWaitersIMSE() { |
1425 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1426 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1426 |
> |
final Condition c = lock.writeLock().newCondition(); |
1427 |
|
try { |
1428 |
|
lock.hasWaiters(c); |
1429 |
|
shouldThrow(); |
1439 |
|
*/ |
1440 |
|
public void testGetWaitQueueLengthIAE() { |
1441 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1442 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1442 |
> |
final Condition c = lock.writeLock().newCondition(); |
1443 |
|
final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock(); |
1444 |
|
try { |
1445 |
|
lock2.getWaitQueueLength(c); |
1455 |
|
*/ |
1456 |
|
public void testGetWaitQueueLengthIMSE() { |
1457 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1458 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1458 |
> |
final Condition c = lock.writeLock().newCondition(); |
1459 |
|
try { |
1460 |
|
lock.getWaitQueueLength(c); |
1461 |
|
shouldThrow(); |
1471 |
|
*/ |
1472 |
|
public void testGetWaitingThreadsIAE() { |
1473 |
|
final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock(); |
1474 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1474 |
> |
final Condition c = lock.writeLock().newCondition(); |
1475 |
|
final PublicReentrantReadWriteLock lock2 = new PublicReentrantReadWriteLock(); |
1476 |
|
try { |
1477 |
|
lock2.getWaitingThreads(c); |
1487 |
|
*/ |
1488 |
|
public void testGetWaitingThreadsIMSE() { |
1489 |
|
final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock(); |
1490 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1490 |
> |
final Condition c = lock.writeLock().newCondition(); |
1491 |
|
try { |
1492 |
|
lock.getWaitingThreads(c); |
1493 |
|
shouldThrow(); |
1503 |
|
*/ |
1504 |
|
public void testHasWaiters() { |
1505 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1506 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1506 |
> |
final Condition c = lock.writeLock().newCondition(); |
1507 |
|
Thread t = new Thread(new Runnable() { |
1508 |
|
public void run() { |
1509 |
|
try { |
1545 |
|
*/ |
1546 |
|
public void testGetWaitQueueLength() { |
1547 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
1548 |
< |
final Condition c = (lock.writeLock().newCondition()); |
1548 |
> |
final Condition c = lock.writeLock().newCondition(); |
1549 |
|
Thread t = new Thread(new Runnable() { |
1550 |
|
public void run() { |
1551 |
|
try { |