--- jsr166/src/test/tck/ReentrantLockTest.java 2009/11/02 20:28:31 1.26 +++ jsr166/src/test/tck/ReentrantLockTest.java 2009/11/16 04:57:10 1.27 @@ -29,7 +29,7 @@ public class ReentrantLockTest extends J public void run() { try { lock.lockInterruptibly(); - } catch(InterruptedException success){} + } catch (InterruptedException success){} } } @@ -45,7 +45,7 @@ public class ReentrantLockTest extends J try { lock.lockInterruptibly(); threadShouldThrow(); - } catch(InterruptedException success){} + } catch (InterruptedException success){} } } @@ -103,7 +103,7 @@ public class ReentrantLockTest extends J rl.unlock(); shouldThrow(); - } catch(IllegalMonitorStateException success){} + } catch (IllegalMonitorStateException success){} } /** @@ -141,7 +141,7 @@ public class ReentrantLockTest extends J assertFalse(lock.hasQueuedThreads()); t1.join(); t2.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -170,7 +170,7 @@ public class ReentrantLockTest extends J assertEquals(0, lock.getQueueLength()); t1.join(); t2.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -199,7 +199,7 @@ public class ReentrantLockTest extends J assertEquals(0, lock.getQueueLength()); t1.join(); t2.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -245,7 +245,7 @@ public class ReentrantLockTest extends J assertFalse(sync.hasQueuedThread(t2)); t1.join(); t2.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -278,7 +278,7 @@ public class ReentrantLockTest extends J assertTrue(lock.getQueuedThreads().isEmpty()); t1.join(); t2.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -295,13 +295,13 @@ public class ReentrantLockTest extends J try { lock.tryLock(MEDIUM_DELAY_MS,TimeUnit.MILLISECONDS); threadShouldThrow(); - } catch(InterruptedException success){} + } catch (InterruptedException success){} } }); try { t.start(); t.interrupt(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -322,7 +322,7 @@ public class ReentrantLockTest extends J t.start(); t.join(); lock.unlock(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -346,7 +346,7 @@ public class ReentrantLockTest extends J t.start(); t.join(); lock.unlock(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -356,11 +356,11 @@ public class ReentrantLockTest extends J */ public void testGetHoldCount() { ReentrantLock lock = new ReentrantLock(); - for(int i = 1; i <= SIZE; i++) { + for (int i = 1; i <= SIZE; i++) { lock.lock(); assertEquals(i,lock.getHoldCount()); } - for(int i = SIZE; i > 0; i--) { + for (int i = SIZE; i > 0; i--) { lock.unlock(); assertEquals(i-1,lock.getHoldCount()); } @@ -382,7 +382,7 @@ public class ReentrantLockTest extends J try { Thread.sleep(SMALL_DELAY_MS); } - catch(Exception e) { + catch (Exception e) { threadUnexpectedException(); } lock.unlock(); @@ -394,7 +394,7 @@ public class ReentrantLockTest extends J assertTrue(lock.isLocked()); t.join(); assertFalse(lock.isLocked()); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -414,7 +414,7 @@ public class ReentrantLockTest extends J Thread.sleep(SHORT_DELAY_MS); lock.unlock(); t.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -426,7 +426,7 @@ public class ReentrantLockTest extends J final ReentrantLock lock = new ReentrantLock(); try { lock.lockInterruptibly(); - } catch(Exception e) { + } catch (Exception e) { unexpectedException(); } Thread t = new Thread(new InterruptedLockRunnable(lock)); @@ -436,7 +436,7 @@ public class ReentrantLockTest extends J assertTrue(lock.isLocked()); assertTrue(lock.isHeldByCurrentThread()); t.join(); - } catch(Exception e){ + } catch (Exception e){ unexpectedException(); } } @@ -538,7 +538,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -714,7 +714,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -756,7 +756,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -771,7 +771,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -816,7 +816,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -830,7 +830,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -938,7 +938,7 @@ public class ReentrantLockTest extends J lock.unlock(); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -969,7 +969,7 @@ public class ReentrantLockTest extends J lock.unlock(); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -1001,7 +1001,7 @@ public class ReentrantLockTest extends J lock.unlock(); threadShouldThrow(); } - catch(InterruptedException success) { + catch (InterruptedException success) { } } }); @@ -1031,7 +1031,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1044,7 +1044,7 @@ public class ReentrantLockTest extends J c.await(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1082,7 +1082,7 @@ public class ReentrantLockTest extends J threadAssertEquals(1, lock.getHoldCount()); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1099,7 +1099,7 @@ public class ReentrantLockTest extends J lock.unlock(); lock.unlock(); } - catch(InterruptedException e) { + catch (InterruptedException e) { threadUnexpectedException(); } } @@ -1141,7 +1141,7 @@ public class ReentrantLockTest extends J ReentrantLock r = (ReentrantLock) in.readObject(); r.lock(); r.unlock(); - } catch(Exception e){ + } catch (Exception e){ e.printStackTrace(); unexpectedException(); }