9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6359979
27 * @summary Compare List implementations for identical behavior
28 * @author Martin Buchholz
29 */
30
31 import java.io.*;
32 import java.util.*;
33 import java.util.concurrent.*;
34 import static java.util.Collections.*;
35
36 @SuppressWarnings("unchecked")
37 public class LockStep {
38 final int DEFAULT_SIZE = 5;
39 int size; // Running time is O(size**2)
40
41 int intArg(String[] args, int i, int defaultValue) {
42 return args.length > i ? Integer.parseInt(args[i]) : defaultValue;
43 }
44
45 boolean maybe(int n) { return rnd.nextInt(n) == 0; }
46
47 void test(String[] args) {
48 size = intArg(args, 0, DEFAULT_SIZE);
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6359979
27 * @summary Compare List implementations for identical behavior
28 * @author Martin Buchholz
29 * @key randomness
30 */
31
32 import java.io.*;
33 import java.util.*;
34 import java.util.concurrent.*;
35 import static java.util.Collections.*;
36
37 @SuppressWarnings("unchecked")
38 public class LockStep {
39 final int DEFAULT_SIZE = 5;
40 int size; // Running time is O(size**2)
41
42 int intArg(String[] args, int i, int defaultValue) {
43 return args.length > i ? Integer.parseInt(args[i]) : defaultValue;
44 }
45
46 boolean maybe(int n) { return rnd.nextInt(n) == 0; }
47
48 void test(String[] args) {
49 size = intArg(args, 0, DEFAULT_SIZE);
|