--- jsr166/src/main/java/util/ArrayPrefixHelpers.java 2014/12/31 04:53:37 1.3 +++ jsr166/src/main/java/util/ArrayPrefixHelpers.java 2015/09/21 01:12:41 1.10 @@ -5,12 +5,13 @@ */ package java.util; -import java.util.concurrent.ForkJoinPool; + import java.util.concurrent.CountedCompleter; +import java.util.concurrent.ForkJoinPool; import java.util.function.BinaryOperator; +import java.util.function.DoubleBinaryOperator; import java.util.function.IntBinaryOperator; import java.util.function.LongBinaryOperator; -import java.util.function.DoubleBinaryOperator; /** * ForkJoin tasks to perform Arrays.parallelPrefix operations. @@ -117,7 +118,7 @@ class ArrayPrefixHelpers { int mid = (l + h) >>> 1; f = rt = t.right = new CumulateTask(t, fn, a, org, fnc, th, mid, h); - t = lt = t.left = + t = lt = t.left = new CumulateTask(t, fn, a, org, fnc, th, l, mid); } else { // possibly refork @@ -269,7 +270,7 @@ class ArrayPrefixHelpers { int mid = (l + h) >>> 1; f = rt = t.right = new LongCumulateTask(t, fn, a, org, fnc, th, mid, h); - t = lt = t.left = + t = lt = t.left = new LongCumulateTask(t, fn, a, org, fnc, th, l, mid); } else { // possibly refork @@ -383,8 +384,8 @@ class ArrayPrefixHelpers { /** Root task constructor */ public DoubleCumulateTask(DoubleCumulateTask parent, - DoubleBinaryOperator function, - double[] array, int lo, int hi) { + DoubleBinaryOperator function, + double[] array, int lo, int hi) { super(parent); this.function = function; this.array = array; this.lo = this.origin = lo; this.hi = this.fence = hi; @@ -396,8 +397,8 @@ class ArrayPrefixHelpers { /** Subtask constructor */ DoubleCumulateTask(DoubleCumulateTask parent, DoubleBinaryOperator function, - double[] array, int origin, int fence, int threshold, - int lo, int hi) { + double[] array, int origin, int fence, int threshold, + int lo, int hi) { super(parent); this.function = function; this.array = array; this.origin = origin; this.fence = fence; @@ -419,7 +420,7 @@ class ArrayPrefixHelpers { int mid = (l + h) >>> 1; f = rt = t.right = new DoubleCumulateTask(t, fn, a, org, fnc, th, mid, h); - t = lt = t.left = + t = lt = t.left = new DoubleCumulateTask(t, fn, a, org, fnc, th, l, mid); } else { // possibly refork @@ -533,8 +534,8 @@ class ArrayPrefixHelpers { /** Root task constructor */ public IntCumulateTask(IntCumulateTask parent, - IntBinaryOperator function, - int[] array, int lo, int hi) { + IntBinaryOperator function, + int[] array, int lo, int hi) { super(parent); this.function = function; this.array = array; this.lo = this.origin = lo; this.hi = this.fence = hi; @@ -546,8 +547,8 @@ class ArrayPrefixHelpers { /** Subtask constructor */ IntCumulateTask(IntCumulateTask parent, IntBinaryOperator function, - int[] array, int origin, int fence, int threshold, - int lo, int hi) { + int[] array, int origin, int fence, int threshold, + int lo, int hi) { super(parent); this.function = function; this.array = array; this.origin = origin; this.fence = fence; @@ -569,7 +570,7 @@ class ArrayPrefixHelpers { int mid = (l + h) >>> 1; f = rt = t.right = new IntCumulateTask(t, fn, a, org, fnc, th, mid, h); - t = lt = t.left = + t = lt = t.left = new IntCumulateTask(t, fn, a, org, fnc, th, l, mid); } else { // possibly refork @@ -673,5 +674,4 @@ class ArrayPrefixHelpers { } private static final long serialVersionUID = 3731755594596840961L; } - }