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

Comparing jsr166/src/main/java/util/concurrent/AbstractExecutorService.java (file contents):
Revision 1.31 by jsr166, Mon Jul 12 19:19:40 2010 UTC vs.
Revision 1.32 by jsr166, Mon Sep 20 20:23:52 2010 UTC

# Line 22 | Line 22 | import java.util.*;
22   * <p> <b>Extension example</b>. Here is a sketch of a class
23   * that customizes {@link ThreadPoolExecutor} to use
24   * a <tt>CustomTask</tt> class instead of the default <tt>FutureTask</tt>:
25 < * <pre>
25 > *  <pre> {@code
26   * public class CustomThreadPoolExecutor extends ThreadPoolExecutor {
27   *
28 < *   static class CustomTask&lt;V&gt; implements RunnableFuture&lt;V&gt; {...}
28 > *   static class CustomTask<V> implements RunnableFuture<V> {...}
29   *
30 < *   protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Callable&lt;V&gt; c) {
31 < *       return new CustomTask&lt;V&gt;(c);
30 > *   protected <V> RunnableFuture<V> newTaskFor(Callable<V> c) {
31 > *       return new CustomTask<V>(c);
32   *   }
33 < *   protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Runnable r, V v) {
34 < *       return new CustomTask&lt;V&gt;(r, v);
33 > *   protected <V> RunnableFuture<V> newTaskFor(Runnable r, V v) {
34 > *       return new CustomTask<V>(r, v);
35   *   }
36   *   // ... add constructors, etc.
37 < * }
38 < * </pre>
37 > * }}</pre>
38 > *
39   * @since 1.5
40   * @author Doug Lea
41   */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines