Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/util/concurrent/FutureTask.java
          +++ new/src/share/classes/java/util/concurrent/FutureTask.java
↓ open down ↓ 77 lines elided ↑ open up ↑
  78   78  
  79   79      /**
  80   80       * Creates a <tt>FutureTask</tt> that will, upon running, execute the
  81   81       * given <tt>Runnable</tt>, and arrange that <tt>get</tt> will return the
  82   82       * given result on successful completion.
  83   83       *
  84   84       * @param runnable the runnable task
  85   85       * @param result the result to return on successful completion. If
  86   86       * you don't need a particular result, consider using
  87   87       * constructions of the form:
  88      -     * <tt>Future&lt;?&gt; f = new FutureTask&lt;Object&gt;(runnable, null)</tt>
       88 +     * {@code Future<?> f = new FutureTask<Void>(runnable, null)}
  89   89       * @throws NullPointerException if runnable is null
  90   90       */
  91   91      public FutureTask(Runnable runnable, V result) {
  92   92          sync = new Sync(Executors.callable(runnable, result));
  93   93      }
  94   94  
  95   95      public boolean isCancelled() {
  96   96          return sync.innerIsCancelled();
  97   97      }
  98   98  
↓ open down ↓ 262 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX