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

Comparing jsr166/src/test/loops/ArraysSort.java (file contents):
Revision 1.1 by dl, Thu Jul 30 20:24:10 2015 UTC vs.
Revision 1.3 by jsr166, Mon Aug 10 06:36:59 2015 UTC

# Line 36 | Line 36 | class ArraysSort {
36              numbers[i] = Long.valueOf(i);
37  
38          int thr = ((n + 7) >>> 3) / ForkJoinPool.getCommonPoolParallelism();
39 <        THRESHOLD = (thr <= 1 << 13)? 1 << 13 : thr;
39 >        THRESHOLD = (thr <= 1 << 13) ? 1 << 13 : thr;
40  
41          System.out.println("Threshold = " + THRESHOLD);
42  
# Line 122 | Line 122 | class ArraysSort {
122  
123      static void checkSorted(Long[] a) {
124          int n = a.length;
125 <        long x = ((Long)a[0]).longValue(), y;
125 >        long x = a[0].longValue(), y;
126          for (int i = 0; i < n - 1; i++) {
127 <            if (x > (y = ((Long)a[i+1]).longValue()))
127 >            if (x > (y = a[i+1].longValue()))
128                  throw new Error("Unsorted at " + i + ": " + x + " / " + y);
129              x = y;
130          }
# Line 153 | Line 153 | class ArraysSort {
153              }
154              ThreadLocalRandom rng = ThreadLocalRandom.current();
155              Long dl = d[l];
156 <            int m = (dl == null)? h : rng.nextInt(l, h);
156 >            int m = (dl == null) ? h : rng.nextInt(l, h);
157              for (int i = l; i < m; ++i)
158                  d[i] = s[rng.nextInt(n)];
159              if (dl != null) {
# Line 185 | Line 185 | class ArraysSort {
185              }
186              int bound = h < n ? h : n - 1;
187              int i = l;
188 <            long x = ((Long)a[i]).longValue(), y;
188 >            long x = a[i].longValue(), y;
189              while (i < bound) {
190 <                if (x > (y = ((Long)a[++i]).longValue()))
190 >                if (x > (y = a[++i].longValue()))
191                      throw new Error("Unsorted " + x + " / " + y);
192                  x = y;
193              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines