--- jsr166/src/jsr166e/CountedCompleter.java 2012/11/25 19:25:06 1.21 +++ jsr166/src/jsr166e/CountedCompleter.java 2012/11/26 12:08:49 1.24 @@ -183,12 +183,13 @@ package jsr166e; * *

Searching. A tree of CountedCompleters can search for a * value or property in different parts of a data structure, and - * report a result in an {@link java.util.concurrent.AtomicReference} - * as soon as one is found. The others can poll the result to avoid - * unnecessary work. (You could additionally {@link #cancel} other - * tasks, but it is usually simpler and more efficient to just let - * them notice that the result is set and if so skip further - * processing.) Illustrating again with an array using full + * report a result in an {@link + * java.util.concurrent.atomic.AtomicReference AtomicReference} as + * soon as one is found. The others can poll the result to avoid + * unnecessary work. (You could additionally {@linkplain #cancel + * cancel} other tasks, but it is usually simpler and more efficient + * to just let them notice that the result is set and if so skip + * further processing.) Illustrating again with an array using full * partitioning (again, in practice, leaf tasks will almost always * process more than one element): * @@ -277,12 +278,12 @@ package jsr166e; * } * public void onCompletion(CountedCompleter caller) { * if (caller != this) { - * MapReducer child = (MapReducer)caller; - * MapReducer sib = child.sibling; - * if (sib == null || sib.result == null) - * result = child.result; - * else - * result = reducer.apply(child.result, sib.result); + * MapReducer child = (MapReducer)caller; + * MapReducer sib = child.sibling; + * if (sib == null || sib.result == null) + * result = child.result; + * else + * result = reducer.apply(child.result, sib.result); * } * } * public E getRawResult() { return result; } @@ -388,7 +389,7 @@ public abstract class CountedCompleter completer, @@ -401,7 +402,7 @@ public abstract class CountedCompleter completer) { this.completer = completer; @@ -422,7 +423,7 @@ public abstract class CountedCompleter caller) { return true;