ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ForkJoinPool.java
(Generate patch)

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.18 by jsr166, Thu Jul 23 23:23:41 2009 UTC vs.
Revision 1.20 by jsr166, Fri Jul 24 22:05:22 2009 UTC

# Line 652 | Line 652 | public class ForkJoinPool extends Abstra
652      }
653  
654      public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) {
655 <        ArrayList<ForkJoinTask<T>> ts =
655 >        ArrayList<ForkJoinTask<T>> forkJoinTasks =
656              new ArrayList<ForkJoinTask<T>>(tasks.size());
657 <        for (Callable<T> c : tasks)
658 <            ts.add(new AdaptedCallable<T>(c));
659 <        invoke(new InvokeAll<T>(ts));
660 <        return (List<Future<T>>) (List) ts;
657 >        for (Callable<T> task : tasks)
658 >            forkJoinTasks.add(new AdaptedCallable<T>(task));
659 >        invoke(new InvokeAll<T>(forkJoinTasks));
660 >
661 >        @SuppressWarnings({"unchecked", "rawtypes"})
662 >        List<Future<T>> futures = (List<Future<T>>) (List) forkJoinTasks;
663 >        return futures;
664      }
665  
666      static final class InvokeAll<T> extends RecursiveAction {
# Line 1834 | Line 1837 | public class ForkJoinPool extends Abstra
1837      // AbstractExecutorService overrides
1838  
1839      protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) {
1840 <        return new AdaptedRunnable(runnable, value);
1840 >        return new AdaptedRunnable<T>(runnable, value);
1841      }
1842  
1843      protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
1844 <        return new AdaptedCallable(callable);
1844 >        return new AdaptedCallable<T>(callable);
1845      }
1846  
1847  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines