--- jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java 2009/11/02 20:28:31 1.5 +++ 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(); } } @@ -437,8 +437,8 @@ public class AbstractQueuedLongSynchroni try { Thread.sleep(SMALL_DELAY_MS); } - catch(Exception e) { - threadUnexpectedException(); + catch (Exception e) { + 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(); } } @@ -481,7 +481,7 @@ public class AbstractQueuedLongSynchroni final Mutex sync = new Mutex(); try { sync.acquireInterruptibly(1); - } catch(Exception e) { + } catch (Exception e) { unexpectedException(); } Thread t = new Thread(new InterruptedSyncRunnable(sync)); @@ -490,7 +490,7 @@ public class AbstractQueuedLongSynchroni t.interrupt(); assertTrue(sync.isHeldExclusively()); t.join(); - } catch(Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -603,8 +603,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + 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(); @@ -781,8 +781,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + threadUnexpectedException(e); } } }); @@ -823,8 +823,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + threadUnexpectedException(e); } } }); @@ -838,8 +838,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + threadUnexpectedException(e); } } }); @@ -883,8 +883,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + threadUnexpectedException(e); } } }); @@ -897,8 +897,8 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { - threadUnexpectedException(); + catch (InterruptedException e) { + threadUnexpectedException(e); } } }); @@ -977,7 +977,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -1008,7 +1008,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -1040,7 +1040,7 @@ public class AbstractQueuedLongSynchroni sync.release(1); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -1070,7 +1070,7 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1083,7 +1083,7 @@ public class AbstractQueuedLongSynchroni c.await(); sync.release(1); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -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(); } }