Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java
          +++ new/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  
  31   31  // based on a test kindly provided by Holger Hoffstaette <holger@wizards.de>
  32   32  
  33   33  import java.util.concurrent.*;
  34   34  import static java.util.concurrent.TimeUnit.MILLISECONDS;
  35   35  
  36   36  public class ScheduledTickleService {
  37   37  
  38   38      // We get intermittent ClassCastException if greater than 1
  39   39      // because of calls to compareTo
  40      -    private final static int concurrency = 2;
       40 +    private static final int concurrency = 2;
  41   41  
  42   42      // Record when tasks are done
  43      -    public final static CountDownLatch done = new CountDownLatch(concurrency);
       43 +    public static final CountDownLatch done = new CountDownLatch(concurrency);
  44   44  
  45   45      public static void realMain(String... args) throws InterruptedException {
  46   46          // our tickle service
  47   47          ScheduledExecutorService tickleService =
  48   48              new ScheduledThreadPoolExecutor(concurrency) {
  49   49                  // We override decorateTask() to return a custom
  50   50                  // RunnableScheduledFuture which explicitly removes
  51   51                  // itself from the queue after cancellation.
  52   52                  protected <V> RunnableScheduledFuture<V>
  53   53                      decorateTask(Runnable runnable,
↓ open down ↓ 133 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX