--- jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2009/11/16 04:57:10 1.3 +++ jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2009/11/16 05:30:08 1.4 @@ -87,14 +87,14 @@ public class ScheduledExecutorSubclassTe try { p1.shutdown(); } catch (SecurityException ok) { return; } try { Thread.sleep(MEDIUM_DELAY_MS); - } catch (InterruptedException e){ + } catch (InterruptedException e) { unexpectedException(); } assertTrue(runnable.done); try { p1.shutdown(); } catch (SecurityException ok) { return; } joinPool(p1); } - catch (Exception e){ + catch (Exception e) { unexpectedException(); } @@ -115,8 +115,8 @@ public class ScheduledExecutorSubclassTe assertEquals(Boolean.TRUE, f.get()); try { p1.shutdown(); } catch (SecurityException ok) { return; } joinPool(p1); - } catch (RejectedExecutionException e){} - catch (Exception e){ + } catch (RejectedExecutionException e) {} + catch (Exception e) { e.printStackTrace(); unexpectedException(); } @@ -136,7 +136,7 @@ public class ScheduledExecutorSubclassTe assertTrue(runnable.done); try { p1.shutdown(); } catch (SecurityException ok) { return; } joinPool(p1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -154,7 +154,7 @@ public class ScheduledExecutorSubclassTe assertTrue(runnable.done); h.cancel(true); joinPool(p1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -177,7 +177,7 @@ public class ScheduledExecutorSubclassTe assertTrue(runnable.done); h.cancel(true); joinPool(p1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -199,7 +199,7 @@ public class ScheduledExecutorSubclassTe assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS); joinPool(p1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -219,7 +219,7 @@ public class ScheduledExecutorSubclassTe assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS); assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS); joinPool(p1); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -234,8 +234,8 @@ public class ScheduledExecutorSubclassTe se = new CustomExecutor(1); se.execute(null); shouldThrow(); - } catch (NullPointerException success){} - catch (Exception e){ + } catch (NullPointerException success) {} + catch (Exception e) { unexpectedException(); } @@ -251,8 +251,8 @@ public class ScheduledExecutorSubclassTe TrackedCallable callable = null; Future f = se.schedule(callable, SHORT_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (NullPointerException success){} - catch (Exception e){ + } catch (NullPointerException success) {} + catch (Exception e) { unexpectedException(); } joinPool(se); @@ -268,7 +268,7 @@ public class ScheduledExecutorSubclassTe se.schedule(new NoOpRunnable(), MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (RejectedExecutionException success){ + } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } @@ -286,7 +286,7 @@ public class ScheduledExecutorSubclassTe se.schedule(new NoOpCallable(), MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (RejectedExecutionException success){ + } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } joinPool(se); @@ -302,7 +302,7 @@ public class ScheduledExecutorSubclassTe se.schedule(new NoOpCallable(), MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (RejectedExecutionException success){ + } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } joinPool(se); @@ -318,7 +318,7 @@ public class ScheduledExecutorSubclassTe se.scheduleAtFixedRate(new NoOpRunnable(), MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (RejectedExecutionException success){ + } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } joinPool(se); @@ -334,7 +334,7 @@ public class ScheduledExecutorSubclassTe se.scheduleWithFixedDelay(new NoOpRunnable(), MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS); shouldThrow(); - } catch (RejectedExecutionException success){ + } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } joinPool(se); @@ -350,7 +350,7 @@ public class ScheduledExecutorSubclassTe p2.execute(new SmallRunnable()); try { Thread.sleep(SHORT_DELAY_MS); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } assertEquals(1, p2.getActiveCount()); @@ -367,7 +367,7 @@ public class ScheduledExecutorSubclassTe p2.execute(new SmallRunnable()); try { Thread.sleep(MEDIUM_DELAY_MS); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } assertEquals(1, p2.getCompletedTaskCount()); @@ -394,7 +394,7 @@ public class ScheduledExecutorSubclassTe p2.execute(new SmallRunnable()); try { Thread.sleep(SHORT_DELAY_MS); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } assertEquals(2, p2.getLargestPoolSize()); @@ -424,7 +424,7 @@ public class ScheduledExecutorSubclassTe p1.execute(new SmallRunnable()); try { Thread.sleep(SHORT_DELAY_MS); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } assertEquals(5, p1.getTaskCount()); @@ -495,7 +495,7 @@ public class ScheduledExecutorSubclassTe try { assertTrue(p1.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS)); assertTrue(p1.isTerminated()); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -516,7 +516,7 @@ public class ScheduledExecutorSubclassTe assertTrue(p1.awaitTermination(LONG_DELAY_MS, TimeUnit.MILLISECONDS)); assertTrue(p1.isTerminated()); assertFalse(p1.isTerminating()); - } catch (Exception e){ + } catch (Exception e) { unexpectedException(); } } @@ -527,7 +527,7 @@ public class ScheduledExecutorSubclassTe public void testGetQueue() { CustomExecutor p1 = new CustomExecutor(1); ScheduledFuture[] tasks = new ScheduledFuture[5]; - for (int i = 0; i < 5; i++){ + for (int i = 0; i < 5; i++) { tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, TimeUnit.MILLISECONDS); } try { @@ -548,7 +548,7 @@ public class ScheduledExecutorSubclassTe public void testRemove() { CustomExecutor p1 = new CustomExecutor(1); ScheduledFuture[] tasks = new ScheduledFuture[5]; - for (int i = 0; i < 5; i++){ + for (int i = 0; i < 5; i++) { tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, TimeUnit.MILLISECONDS); } try { @@ -576,7 +576,7 @@ public class ScheduledExecutorSubclassTe public void testPurge() { CustomExecutor p1 = new CustomExecutor(1); ScheduledFuture[] tasks = new ScheduledFuture[5]; - for (int i = 0; i < 5; i++){ + for (int i = 0; i < 5; i++) { tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, TimeUnit.MILLISECONDS); } try {