--- jsr166/src/test/tck/LinkedBlockingQueueTest.java 2009/11/16 04:57:10 1.13 +++ jsr166/src/test/tck/LinkedBlockingQueueTest.java 2009/11/16 05:30:07 1.14 @@ -183,7 +183,7 @@ public class LinkedBlockingQueueTest ext } assertEquals(0, q.remainingCapacity()); q.add(new Integer(SIZE)); - } catch (IllegalStateException success){ + } catch (IllegalStateException success) { } } @@ -279,7 +279,7 @@ public class LinkedBlockingQueueTest ext q.put(null); shouldThrow(); } - catch (NullPointerException success){ + catch (NullPointerException success) { } catch (InterruptedException ie) { unexpectedException(); @@ -319,7 +319,7 @@ public class LinkedBlockingQueueTest ext } q.put(new Integer(SIZE)); threadShouldThrow(); - } catch (InterruptedException ie){ + } catch (InterruptedException ie) { threadAssertEquals(added, SIZE); } }}); @@ -352,7 +352,7 @@ public class LinkedBlockingQueueTest ext q.put(new Object()); ++added; threadShouldThrow(); - } catch (InterruptedException e){ + } catch (InterruptedException e) { threadAssertTrue(added >= 2); } } @@ -363,7 +363,7 @@ public class LinkedBlockingQueueTest ext q.take(); t.interrupt(); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -381,7 +381,7 @@ public class LinkedBlockingQueueTest ext threadAssertFalse(q.offer(new Object(), SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); q.offer(new Object(), LONG_DELAY_MS, TimeUnit.MILLISECONDS); threadShouldThrow(); - } catch (InterruptedException success){} + } catch (InterruptedException success) {} } }); @@ -390,7 +390,7 @@ public class LinkedBlockingQueueTest ext Thread.sleep(SMALL_DELAY_MS); t.interrupt(); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -404,7 +404,7 @@ public class LinkedBlockingQueueTest ext for (int i = 0; i < SIZE; ++i) { assertEquals(i, ((Integer)q.take()).intValue()); } - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -419,7 +419,7 @@ public class LinkedBlockingQueueTest ext try { q.take(); threadShouldThrow(); - } catch (InterruptedException success){ } + } catch (InterruptedException success) { } } }); try { @@ -427,7 +427,7 @@ public class LinkedBlockingQueueTest ext Thread.sleep(SHORT_DELAY_MS); t.interrupt(); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -445,7 +445,7 @@ public class LinkedBlockingQueueTest ext } q.take(); threadShouldThrow(); - } catch (InterruptedException success){ + } catch (InterruptedException success) { } }}); t.start(); @@ -481,7 +481,7 @@ public class LinkedBlockingQueueTest ext assertEquals(i, ((Integer)q.poll(0, TimeUnit.MILLISECONDS)).intValue()); } assertNull(q.poll(0, TimeUnit.MILLISECONDS)); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -496,7 +496,7 @@ public class LinkedBlockingQueueTest ext assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)).intValue()); } assertNull(q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -514,7 +514,7 @@ public class LinkedBlockingQueueTest ext threadAssertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)).intValue()); } threadAssertNull(q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); - } catch (InterruptedException success){ + } catch (InterruptedException success) { } }}); t.start(); @@ -550,7 +550,7 @@ public class LinkedBlockingQueueTest ext assertTrue(q.offer(zero, SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); t.interrupt(); t.join(); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -596,7 +596,7 @@ public class LinkedBlockingQueueTest ext try { q.remove(); shouldThrow(); - } catch (NoSuchElementException success){ + } catch (NoSuchElementException success) { } } @@ -627,7 +627,7 @@ public class LinkedBlockingQueueTest ext assertTrue(q.remove(new Integer(2))); assertTrue(q.add(new Integer(3))); assertTrue(q.take() != null); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -718,7 +718,7 @@ public class LinkedBlockingQueueTest ext try { for (int i = 0; i < o.length; i++) assertEquals(o[i], q.take()); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -733,7 +733,7 @@ public class LinkedBlockingQueueTest ext try { for (int i = 0; i < ints.length; i++) assertEquals(ints[i], q.take()); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -746,7 +746,7 @@ public class LinkedBlockingQueueTest ext LinkedBlockingQueue q = populatedQueue(SIZE); Object o[] = q.toArray(null); shouldThrow(); - } catch (NullPointerException success){} + } catch (NullPointerException success) {} } /** @@ -757,7 +757,7 @@ public class LinkedBlockingQueueTest ext LinkedBlockingQueue q = populatedQueue(SIZE); Object o[] = q.toArray(new String[10] ); shouldThrow(); - } catch (ArrayStoreException success){} + } catch (ArrayStoreException success) {} } @@ -768,10 +768,10 @@ public class LinkedBlockingQueueTest ext LinkedBlockingQueue q = populatedQueue(SIZE); Iterator it = q.iterator(); try { - while (it.hasNext()){ + while (it.hasNext()) { assertEquals(it.next(), q.take()); } - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } } @@ -934,7 +934,7 @@ public class LinkedBlockingQueueTest ext assertEquals(q.size(), r.size()); while (!q.isEmpty()) assertEquals(q.remove(), r.remove()); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -996,7 +996,7 @@ public class LinkedBlockingQueueTest ext public void run() { try { q.put(new Integer(SIZE+1)); - } catch (InterruptedException ie){ + } catch (InterruptedException ie) { threadUnexpectedException(); } } @@ -1010,7 +1010,7 @@ public class LinkedBlockingQueueTest ext assertEquals(l.get(i), new Integer(i)); t.join(); assertTrue(q.size() + l.size() >= SIZE); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } }