--- jsr166/src/jsr166y/ForkJoinTask.java 2011/03/04 13:29:39 1.76 +++ jsr166/src/jsr166y/ForkJoinTask.java 2011/07/01 18:30:14 1.80 @@ -1,24 +1,20 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ package jsr166y; import java.io.Serializable; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.RandomAccess; -import java.util.Map; import java.lang.ref.WeakReference; import java.lang.ref.ReferenceQueue; import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.RunnableFuture; @@ -165,12 +161,14 @@ public abstract class ForkJoinTask im * See the internal documentation of class ForkJoinPool for a * general implementation overview. ForkJoinTasks are mainly * responsible for maintaining their "status" field amidst relays - * to methods in ForkJoinWorkerThread and ForkJoinPool. The - * methods of this class are more-or-less layered into (1) basic - * status maintenance (2) execution and awaiting completion (3) - * user-level methods that additionally report results. This is - * sometimes hard to see because this file orders exported methods - * in a way that flows well in javadocs. + * to methods in ForkJoinWorkerThread and ForkJoinPool. + * + * The methods of this class are more-or-less layered into + * (1) basic status maintenance + * (2) execution and awaiting completion + * (3) user-level methods that additionally report results. + * This is sometimes hard to see because this file orders exported + * methods in a way that flows well in javadocs. */ /* @@ -491,7 +489,7 @@ public abstract class ForkJoinTask im if (e == null || (ex = e.ex) == null) return null; if (e.thrower != Thread.currentThread().getId()) { - Class ec = ex.getClass(); + Class ec = ex.getClass(); try { Constructor noArgCtor = null; Constructor[] cs = ec.getConstructors();// public ctors only @@ -697,7 +695,7 @@ public abstract class ForkJoinTask im if (t != null) { if (ex != null) t.cancel(false); - else if (t.doJoin() < NORMAL && ex == null) + else if (t.doJoin() < NORMAL) ex = t.getException(); } } @@ -754,7 +752,7 @@ public abstract class ForkJoinTask im if (t != null) { if (ex != null) t.cancel(false); - else if (t.doJoin() < NORMAL && ex == null) + else if (t.doJoin() < NORMAL) ex = t.getException(); } }