ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ExecutorCompletionService.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ExecutorCompletionService.java (file contents):
Revision 1.6 by dl, Fri Dec 19 14:42:25 2003 UTC vs.
Revision 1.7 by dl, Sun Dec 21 12:24:48 2003 UTC

# Line 9 | Line 9 | package java.util.concurrent;
9  
10   /**
11   * A {@link CompletionService} that uses a supplied {@link Executor}
12 < * to execute tasks.
12 > * to execute tasks.  This class arranges that submitted tasks are,
13 > * upon completion, placed on a queue accessible using <tt>take</tt>.
14 > * The class is lightweight enough to be suitable for transient use
15 > * when processing groups of tasks.
16   *
17   * <p>
18   *
# Line 100 | Line 103 | public class ExecutorCompletionService<V
103       * executor for base task execution and the supplied queue as its
104       * completion queue.
105       * @param executor the executor to use
106 <     * @param completionQueue the queue to use as the completion queue;
106 >     * @param completionQueue the queue to use as the completion queue
107       * normally one dedicated for use by this service
108       8 @throws NullPointerException if executor or completionQueue are <tt>null</tt>
109       */
# Line 113 | Line 116 | public class ExecutorCompletionService<V
116      }
117  
118      public Future<V> submit(Callable<V> task) {
119 +        if (task == null) throw new NullPointerException();
120          QueueingFuture f = new QueueingFuture(task);
121          executor.execute(f);
122          return f;
123      }
124  
125      public Future<V> submit(Runnable task, V result) {
126 +        if (task == null) throw new NullPointerException();
127          QueueingFuture f = new QueueingFuture(task, result);
128          executor.execute(f);
129          return f;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines