--- old/test/jdk/java/util/Arrays/ParallelSorting.java 2018-01-18 06:09:11.474015532 -0800 +++ new/test/jdk/java/util/Arrays/ParallelSorting.java 2018-01-18 06:09:11.077978781 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,38 +23,41 @@ /* Adapted from test/java/util/Arrays/Sorting.java * + * To generate the source of this class, take the source of Sorting.java + * and replace "Arrays.sort' by "Arrays.parallelSort'. + * * Where that test checks Arrays.sort against manual quicksort routines, - * this test checks parallelSort against either Arrays.sort or manual - * quicksort routines. + * this test checks parallelSort against manual quicksort routines. */ /* * @test * @bug 8003981 * @run main ParallelSorting -shortrun - * @summary Exercise Arrays.parallelSort (adapted from test Sorting) + * @summary Exercise Arrays.parallelSort * * @author Vladimir Yaroslavskiy * @author Jon Bentley * @author Josh Bloch */ +import java.io.PrintStream; import java.util.Arrays; import java.util.Random; -import java.io.PrintStream; import java.util.Comparator; public class ParallelSorting { + private static final PrintStream out = System.out; private static final PrintStream err = System.err; // Array lengths used in a long run (default) private static final int[] LONG_RUN_LENGTHS = { - 1000, 10000, 100000, 1000000 }; + 1, 2, 3, 5, 8, 13, 21, 34, 55, 100, 1000, 10000, 100000, 1000000 }; // Array lengths used in a short run private static final int[] SHORT_RUN_LENGTHS = { - 5000, 9000, 10000, 12000 }; + 1, 2, 3, 21, 55, 1000, 10000, 12000 }; // Random initial values used in a long run (default) private static final long[] LONG_RUN_RANDOMS = { 666, 0xC0FFEE, 999 }; @@ -62,6 +65,10 @@ // Random initial values used in a short run private static final long[] SHORT_RUN_RANDOMS = { 666 }; + // Constant values used in subarray sorting + private static final int A380 = 0xA380; + private static final int B747 = 0xB747; + public static void main(String[] args) { boolean shortRun = args.length > 0 && args[0].equals("-shortrun"); long start = System.currentTimeMillis(); @@ -86,7 +93,7 @@ testEmptyAndNullDoubleArray(); for (int length : lengths) { - testMergeSort(length); + testMergingSort(length); testAndCheckRange(length); testAndCheckSubArray(length); } @@ -104,8 +111,8 @@ private static void testEmptyAndNullIntArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new int[]{}); - Arrays.parallelSort(new int[]{}, 0, 0); + Arrays.parallelSort(new int[] {}); + Arrays.parallelSort(new int[] {}, 0, 0); try { Arrays.parallelSort((int[]) null); @@ -123,8 +130,8 @@ private static void testEmptyAndNullLongArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new long[]{}); - Arrays.parallelSort(new long[]{}, 0, 0); + Arrays.parallelSort(new long[] {}); + Arrays.parallelSort(new long[] {}, 0, 0); try { Arrays.parallelSort((long[]) null); @@ -142,8 +149,8 @@ private static void testEmptyAndNullShortArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new short[]{}); - Arrays.parallelSort(new short[]{}, 0, 0); + Arrays.parallelSort(new short[] {}); + Arrays.parallelSort(new short[] {}, 0, 0); try { Arrays.parallelSort((short[]) null); @@ -161,8 +168,8 @@ private static void testEmptyAndNullCharArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new char[]{}); - Arrays.parallelSort(new char[]{}, 0, 0); + Arrays.parallelSort(new char[] {}); + Arrays.parallelSort(new char[] {}, 0, 0); try { Arrays.parallelSort((char[]) null); @@ -180,8 +187,8 @@ private static void testEmptyAndNullByteArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new byte[]{}); - Arrays.parallelSort(new byte[]{}, 0, 0); + Arrays.parallelSort(new byte[] {}); + Arrays.parallelSort(new byte[] {}, 0, 0); try { Arrays.parallelSort((byte[]) null); @@ -199,8 +206,8 @@ private static void testEmptyAndNullFloatArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new float[]{}); - Arrays.parallelSort(new float[]{}, 0, 0); + Arrays.parallelSort(new float[] {}); + Arrays.parallelSort(new float[] {}, 0, 0); try { Arrays.parallelSort((float[]) null); @@ -218,8 +225,8 @@ private static void testEmptyAndNullDoubleArray() { ourDescription = "Check empty and null array"; - Arrays.parallelSort(new double[]{}); - Arrays.parallelSort(new double[]{}, 0, 0); + Arrays.parallelSort(new double[] {}); + Arrays.parallelSort(new double[] {}, 0, 0); try { Arrays.parallelSort((double[]) null); @@ -295,11 +302,10 @@ out.println("Test 'stable' comparator: " + "random = " + random.getSeed() + ", length = " + length); - Arrays.parallelSort(a, pairCmp); + Arrays.parallelSort(a, pairComparator); checkSorted(a); checkStable(a); out.println(); - } private static void checkSorted(Pair[] a) { @@ -346,7 +352,7 @@ return a; } - private static Comparator pairCmp = new Comparator() { + private static Comparator pairComparator = new Comparator() { public int compare(Pair p1, Pair p2) { return p1.compareTo(p2); } @@ -414,21 +420,21 @@ out.println(); } - private static void testMergeSort(int length) { + private static void testMergingSort(int length) { if (length < 1000) { return; } - ourDescription = "Check merge sorting"; + ourDescription = "Check merging sort"; int[] golden = new int[length]; - int period = 67; // java.util.DualPivotQuicksort.MAX_RUN_COUNT + final int period = 50; for (int m = period - 2; m <= period + 2; m++) { - for (MergeBuilder builder : MergeBuilder.values()) { + for (MergingBuilder builder : MergingBuilder.values()) { builder.build(golden, m); int[] test = golden.clone(); for (TypeConverter converter : TypeConverter.values()) { - out.println("Test 'merge sort': " + converter + " " + + out.println("Test 'merging sort': " + converter + " " + builder + "length = " + length + ", m = " + m); Object convertedGolden = converter.convert(golden); sort(convertedGolden); @@ -492,18 +498,15 @@ private static void testAndCheckFloat(int length, MyRandom random) { ourDescription = "Check float sorting"; float[] golden = new float[length]; - final int MAX = 10; boolean newLine = false; + final int MAX = 12; for (int a = 0; a <= MAX; a++) { for (int g = 0; g <= MAX; g++) { for (int z = 0; z <= MAX; z++) { for (int n = 0; n <= MAX; n++) { for (int p = 0; p <= MAX; p++) { - if (a + g + z + n + p > length) { - continue; - } - if (a + g + z + n + p < length) { + if (a + g + z + n + p != length) { continue; } for (FloatBuilder builder : FloatBuilder.values()) { @@ -567,7 +570,7 @@ private static void prepareSubArray(int[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - a[i] = 0xDEDA; + a[i] = A380; } int middle = (fromIndex + toIndex) >>> 1; int k = 0; @@ -579,7 +582,7 @@ a[i] = k--; } for (int i = toIndex; i < a.length; i++) { - a[i] = 0xBABA; + a[i] = B747; } } @@ -690,7 +693,7 @@ Integer[] b = new Integer[a.length]; for (int i = 0; i < a.length; i++) { - b[i] = new Integer(a[i]); + b[i] = Integer.valueOf(a[i]); } return b; } @@ -698,7 +701,8 @@ abstract Object convert(int[] a); - @Override public String toString() { + @Override + public String toString() { String name = name(); for (int i = name.length(); i < 9; i++) { @@ -851,7 +855,8 @@ abstract void build(int[] a, int m); - @Override public String toString() { + @Override + public String toString() { String name = name(); for (int i = name.length(); i < 12; i++) { @@ -861,7 +866,7 @@ } } - private static enum MergeBuilder { + private static enum MergingBuilder { ASCENDING { void build(int[] a, int m) { int period = a.length / m; @@ -895,11 +900,53 @@ } a[a.length - 1] = 0; } + }, + POINT { + void build(int[] a, int m) { + for (int i = 0; i < a.length; i++) { + a[i] = 0; + } + a[a.length / 2] = m; + } + }, + LINE { + void build(int[] a, int m) { + for (int i = 0; i < a.length; i++) { + a[i] = i; + } + reverse(a, 0, a.length - 1); + } + }, + PEARL { + void build(int[] a, int m) { + for (int i = 0; i < a.length; i++) { + a[i] = i; + } + reverse(a, 0, 2); + } + }, + RING { + void build(int[] a, int m) { + int k1 = a.length / 3; + int k2 = a.length / 3 * 2; + int level = a.length / 3; + + for (int i = 0, k = level; i < k1; i++) { + a[i] = k--; + } + for (int i = k1; i < k2; i++) { + a[i] = 0; + } + for (int i = k2, k = level; i < a.length; i++) { + a[i] = k--; + } + } }; abstract void build(int[] a, int m); - @Override public String toString() { + @Override + public String toString() { String name = name(); for (int i = name.length(); i < 12; i++) { @@ -909,6 +956,14 @@ } } + private static void reverse(int[] a, int lo, int hi) { + for (--hi; lo < hi; ) { + int tmp = a[lo]; + a[lo++] = a[hi]; + a[hi--] = tmp; + } + } + private static enum UnsortedBuilder { RANDOM { void build(int[] a, int m, Random random) { @@ -1015,7 +1070,8 @@ abstract void build(int[] a, int m, Random random); - @Override public String toString() { + @Override + public String toString() { String name = name(); for (int i = name.length(); i < 12; i++) { @@ -1062,7 +1118,7 @@ } else if (test instanceof Integer[]) { compare((Integer[]) test, (Integer[]) golden); } else { - failed("Unknow type of array: " + test + " of class " + + failed("Unknown type of array: " + test + " of class " + test.getClass().getName()); } } @@ -1149,7 +1205,7 @@ } else if (object instanceof Integer[]) { checkSorted((Integer[]) object); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } @@ -1245,7 +1301,7 @@ } else if (object instanceof Integer[]) { return checkSumXor((Integer[]) object); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); return -1; } @@ -1341,7 +1397,7 @@ } else if (object instanceof Integer[]) { return checkSumPlus((Integer[]) object); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); return -1; } @@ -1437,7 +1493,7 @@ } else if (object instanceof Integer[]) { sortByInsertionSort((Integer[]) object); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } @@ -1540,7 +1596,7 @@ } else if (object instanceof Integer[]) { Arrays.parallelSort((Integer[]) object); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } @@ -1563,7 +1619,7 @@ } else if (object instanceof Integer[]) { Arrays.parallelSort((Integer[]) object, fromIndex, toIndex); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } @@ -1586,16 +1642,16 @@ } else if (object instanceof Integer[]) { checkSubArray((Integer[]) object, fromIndex, toIndex, m); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } private static void checkSubArray(Integer[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i].intValue() != 0xDEDA) { + if (a[i].intValue() != A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1606,18 +1662,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i].intValue() != 0xBABA) { + if (a[i].intValue() != B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(int[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != 0xDEDA) { + if (a[i] != A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1628,18 +1684,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != 0xBABA) { + if (a[i] != B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(byte[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (byte) 0xDEDA) { + if (a[i] != (byte) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1650,18 +1706,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (byte) 0xBABA) { + if (a[i] != (byte) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(long[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (long) 0xDEDA) { + if (a[i] != (long) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1672,18 +1728,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (long) 0xBABA) { + if (a[i] != (long) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(char[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (char) 0xDEDA) { + if (a[i] != (char) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1694,18 +1750,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (char) 0xBABA) { + if (a[i] != (char) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(short[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (short) 0xDEDA) { + if (a[i] != (short) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1716,18 +1772,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (short) 0xBABA) { + if (a[i] != (short) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(float[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (float) 0xDEDA) { + if (a[i] != (float) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1738,18 +1794,18 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (float) 0xBABA) { + if (a[i] != (float) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } private static void checkSubArray(double[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (double) 0xDEDA) { + if (a[i] != (double) A380) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + A380); } } @@ -1760,9 +1816,9 @@ } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (double) 0xBABA) { + if (a[i] != (double) B747) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + B747); } } } @@ -1785,7 +1841,7 @@ } else if (object instanceof Integer[]) { checkRange((Integer[]) object, m); } else { - failed("Unknow type of array: " + object + " of class " + + failed("Unknown type of array: " + object + " of class " + object.getClass().getName()); } } @@ -1794,7 +1850,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1802,14 +1858,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1823,7 +1879,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1831,14 +1887,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1852,7 +1908,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1860,14 +1916,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1881,7 +1937,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1889,14 +1945,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1910,7 +1966,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1918,14 +1974,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1939,7 +1995,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1947,14 +2003,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1968,7 +2024,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -1976,14 +2032,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) { @@ -1997,7 +2053,7 @@ try { Arrays.parallelSort(a, m + 1, m); - failed("ParallelSort does not throw IllegalArgumentException " + + failed("Arrays.parallelSort does not throw IllegalArgumentException " + " as expected: fromIndex = " + (m + 1) + " toIndex = " + m); } @@ -2005,14 +2061,14 @@ try { Arrays.parallelSort(a, -m, a.length); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: fromIndex = " + (-m)); } catch (ArrayIndexOutOfBoundsException aoe) { try { Arrays.parallelSort(a, 0, a.length + m); - failed("ParallelSort does not throw ArrayIndexOutOfBoundsException " + + failed("Arrays.parallelSort does not throw ArrayIndexOutOfBoundsException " + " as expected: toIndex = " + (a.length + m)); } catch (ArrayIndexOutOfBoundsException aie) {