--- jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java 2009/11/16 04:57:09 1.6 +++ jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java 2009/11/17 13:40:14 1.8 @@ -76,7 +76,7 @@ public class AbstractQueuedLongSynchroni public void run() { try { sync.acquireInterruptibly(1); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } } @@ -92,7 +92,7 @@ public class AbstractQueuedLongSynchroni try { sync.acquireInterruptibly(1); threadShouldThrow(); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } } @@ -149,7 +149,7 @@ public class AbstractQueuedLongSynchroni assertFalse(sync.hasQueuedThreads()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -195,7 +195,7 @@ public class AbstractQueuedLongSynchroni assertFalse(sync.isQueued(t2)); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -225,7 +225,7 @@ public class AbstractQueuedLongSynchroni assertNull(sync.getFirstQueuedThread()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -255,7 +255,7 @@ public class AbstractQueuedLongSynchroni assertTrue(sync.hasContended()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -287,7 +287,7 @@ public class AbstractQueuedLongSynchroni assertTrue(sync.getQueuedThreads().isEmpty()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -319,7 +319,7 @@ public class AbstractQueuedLongSynchroni assertTrue(sync.getExclusiveQueuedThreads().isEmpty()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -349,7 +349,7 @@ public class AbstractQueuedLongSynchroni assertTrue(sync.getSharedQueuedThreads().isEmpty()); t1.join(); t2.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -365,13 +365,13 @@ public class AbstractQueuedLongSynchroni try { sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000 * 1000); threadShouldThrow(); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } }); try { t.start(); t.interrupt(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -392,7 +392,7 @@ public class AbstractQueuedLongSynchroni t.start(); t.join(); sync.release(1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -408,7 +408,7 @@ public class AbstractQueuedLongSynchroni try { threadAssertFalse(sync.tryAcquireNanos(1, 1000 * 1000)); } catch (Exception ex) { - threadUnexpectedException(); + threadUnexpectedException(ex); } } }); @@ -416,7 +416,7 @@ public class AbstractQueuedLongSynchroni t.start(); t.join(); sync.release(1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -438,7 +438,7 @@ public class AbstractQueuedLongSynchroni Thread.sleep(SMALL_DELAY_MS); } catch (Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } sync.release(1); } @@ -449,7 +449,7 @@ public class AbstractQueuedLongSynchroni assertTrue(sync.isHeldExclusively()); t.join(); assertFalse(sync.isHeldExclusively()); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -469,7 +469,7 @@ public class AbstractQueuedLongSynchroni Thread.sleep(SHORT_DELAY_MS); sync.release(1); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -490,7 +490,7 @@ public class AbstractQueuedLongSynchroni t.interrupt(); assertTrue(sync.isHeldExclusively()); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -604,7 +604,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -674,7 +674,7 @@ public class AbstractQueuedLongSynchroni */ public void testHasWaitersIAE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); final Mutex sync2 = new Mutex(); try { sync2.hasWaiters(c); @@ -690,7 +690,7 @@ public class AbstractQueuedLongSynchroni */ public void testHasWaitersIMSE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); try { sync.hasWaiters(c); shouldThrow(); @@ -706,7 +706,7 @@ public class AbstractQueuedLongSynchroni */ public void testGetWaitQueueLengthIAE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); final Mutex sync2 = new Mutex(); try { sync2.getWaitQueueLength(c); @@ -722,7 +722,7 @@ public class AbstractQueuedLongSynchroni */ public void testGetWaitQueueLengthIMSE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); try { sync.getWaitQueueLength(c); shouldThrow(); @@ -738,7 +738,7 @@ public class AbstractQueuedLongSynchroni */ public void testGetWaitingThreadsIAE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); final Mutex sync2 = new Mutex(); try { sync2.getWaitingThreads(c); @@ -754,7 +754,7 @@ public class AbstractQueuedLongSynchroni */ public void testGetWaitingThreadsIMSE() { final Mutex sync = new Mutex(); - final AbstractQueuedLongSynchronizer.ConditionObject c = (sync.newCondition()); + final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition(); try { sync.getWaitingThreads(c); shouldThrow(); @@ -782,7 +782,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -824,7 +824,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -839,7 +839,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -884,7 +884,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -898,7 +898,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); } catch (InterruptedException e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }); @@ -1137,7 +1137,7 @@ public class AbstractQueuedLongSynchroni ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); Mutex r = (Mutex) in.readObject(); assertTrue(r.isHeldExclusively()); - } catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); unexpectedException(); } @@ -1178,7 +1178,7 @@ public class AbstractQueuedLongSynchroni threadAssertFalse(l.isSignalled()); l.acquireSharedInterruptibly(0); threadAssertTrue(l.isSignalled()); - } catch (InterruptedException e){ + } catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1190,7 +1190,7 @@ public class AbstractQueuedLongSynchroni l.releaseShared(0); assertTrue(l.isSignalled()); t.join(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -1209,7 +1209,7 @@ public class AbstractQueuedLongSynchroni threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS* 1000 * 1000)); threadAssertTrue(l.isSignalled()); - } catch (InterruptedException e){ + } catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1221,7 +1221,7 @@ public class AbstractQueuedLongSynchroni l.releaseShared(0); assertTrue(l.isSignalled()); t.join(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -1237,7 +1237,7 @@ public class AbstractQueuedLongSynchroni threadAssertFalse(l.isSignalled()); l.acquireSharedInterruptibly(0); threadShouldThrow(); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } }); t.start(); @@ -1245,7 +1245,7 @@ public class AbstractQueuedLongSynchroni assertFalse(l.isSignalled()); t.interrupt(); t.join(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -1261,7 +1261,7 @@ public class AbstractQueuedLongSynchroni threadAssertFalse(l.isSignalled()); l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000); threadShouldThrow(); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } }); t.start(); @@ -1270,7 +1270,7 @@ public class AbstractQueuedLongSynchroni assertFalse(l.isSignalled()); t.interrupt(); t.join(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -1285,7 +1285,7 @@ public class AbstractQueuedLongSynchroni try { threadAssertFalse(l.isSignalled()); threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000)); - } catch (InterruptedException ie){ + } catch (InterruptedException ie) { threadUnexpectedException(); } } @@ -1295,7 +1295,7 @@ public class AbstractQueuedLongSynchroni Thread.sleep(SHORT_DELAY_MS); assertFalse(l.isSignalled()); t.join(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } }