author | prr |
Fri, 25 May 2018 12:12:24 -0700 | |
changeset 50347 | b2f046ae8eb6 |
parent 48742 | 364944ba4e2f |
permissions | -rw-r--r-- |
48742
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
1 |
/* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
4 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
8 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
13 |
* accompanied this code). |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
14 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
18 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
21 |
* questions. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
22 |
*/ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
23 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
24 |
/* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
25 |
* @test |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
26 |
* @bug 4087516 |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
27 |
* @summary Incorrect locking leads to deadlock in monitorCacheMaybeExpand. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
28 |
* @author Anand Palaniswamy |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
29 |
* @build MonitorCacheMaybeExpand_DeadLock |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
30 |
* @run main/othervm MonitorCacheMaybeExpand_DeadLock |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
31 |
*/ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
32 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
33 |
/** |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
34 |
* Background on the bug: |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
35 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
36 |
* The thread local monitor cache had a locking bug (till |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
37 |
* 1.2beta1) where two threads trying to expand the monitor cache |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
38 |
* at the same time would cause deadlock. The code paths that the |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
39 |
* two threads must be executing for this to happen is described |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
40 |
* in the bug report. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
41 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
42 |
* Caveat and red-flag: |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
43 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
44 |
* Since deadlocks are very timing dependent, there is a good |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
45 |
* chance this test case will not catch the bug most of the time |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
46 |
* -- on your machine and setting, it is _possible_ that the two |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
47 |
* threads might not try a monitorCacheExpand at the same |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
48 |
* time. But in practice, on Solaris native threads, this program |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
49 |
* deadlocks the VM in about 2 seconds pretty consistently, |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
50 |
* whether MP or not. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
51 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
52 |
* The rationale for running this test despite this rather large |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
53 |
* caveat is that at worst, it can do no harm. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
54 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
55 |
* The idea: |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
56 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
57 |
* Is to create two monitor hungry threads. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
58 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
59 |
* Originally Tom Rodriguez and I suspected that this weird state |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
60 |
* of two threads trying to expand monitor cache can happen only |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
61 |
* if: |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
62 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
63 |
* Thread 1: Is in the middle of a monitorCacheMaybeExpand. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
64 |
* Thread 2: Runs GC and tries to freeClasses(). This causes |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
65 |
* sysFree() to be invoked, which in turn needs a |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
66 |
* mutex_lock -- and oops, we end up deadlocking |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
67 |
* with 1 on green_threads. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
68 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
69 |
* Which is why this test tries to cause class GC at regular |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
70 |
* intervals. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
71 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
72 |
* Turns out that the GC is not required. Two instances of the |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
73 |
* monitor hungry threads deadlock the VM pretty quick. :-) Infact |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
74 |
* the static initializer in the forName'd classes running |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
75 |
* alongside one of the hungry threads is sufficient to |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
76 |
* deadlock. Still keep the GC stuff just-in-case (and also |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
77 |
* because I wrote it :-). |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
78 |
* |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
79 |
*/ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
80 |
public class MonitorCacheMaybeExpand_DeadLock { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
81 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
82 |
/** |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
83 |
* A monitor-hungry thread. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
84 |
*/ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
85 |
static class LotsaMonitors extends Thread { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
86 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
87 |
/** How many recursions? Could cause Java stack overflow. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
88 |
static final int MAX_DEPTH = 800; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
89 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
90 |
/** What is our depth? */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
91 |
int depth = 0; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
92 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
93 |
/** Thread ID */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
94 |
int tid; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
95 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
96 |
/** So output will have thread number. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
97 |
public LotsaMonitors(int tid, int depth) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
98 |
super("LotsaMonitors #" + new Integer(tid).toString()); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
99 |
this.tid = tid; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
100 |
this.depth = depth; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
101 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
102 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
103 |
/** Start a recursion that grabs monitors. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
104 |
public void run() { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
105 |
System.out.println(">>>Starting " + this.toString() + " ..."); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
106 |
Thread.currentThread().yield(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
107 |
this.recurse(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
108 |
System.out.println("<<<Finished " + this.toString()); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
109 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
110 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
111 |
/** Every call to this method grabs an extra monitor. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
112 |
synchronized void recurse() { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
113 |
if (this.depth > 0) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
114 |
new LotsaMonitors(tid, depth-1).recurse(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
115 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
116 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
117 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
118 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
119 |
/** |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
120 |
* The test. |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
121 |
*/ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
122 |
public static void main(String[] args) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
123 |
/* Start the two of these crazy threads. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
124 |
new LotsaMonitors(1, LotsaMonitors.MAX_DEPTH).start(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
125 |
new LotsaMonitors(2, LotsaMonitors.MAX_DEPTH).start(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
126 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
127 |
/* And sit there and GC for good measure. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
128 |
for (int i = 0; i < MAX_GC_ITERATIONS; i++) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
129 |
new LotsaMonitors(i+3, LotsaMonitors.MAX_DEPTH).start(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
130 |
System.out.println(">>>Loading 10 classes and gc'ing ..."); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
131 |
Class[] classes = new Class[10]; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
132 |
fillClasses(classes); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
133 |
classes = null; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
134 |
System.gc(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
135 |
Thread.currentThread().yield(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
136 |
System.out.println("<<<Finished loading 10 classes and gc'ing"); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
137 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
138 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
139 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
140 |
/** How many times to GC? */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
141 |
static final int MAX_GC_ITERATIONS = 10; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
142 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
143 |
/** Load some classes into the array. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
144 |
static void fillClasses(Class[] classes) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
145 |
for (int i = 0; i < classes.length; i++) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
146 |
try { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
147 |
classes[i] = Class.forName(classnames[i]); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
148 |
} catch (ClassNotFoundException cnfe) { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
149 |
cnfe.printStackTrace(); |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
150 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
151 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
152 |
} |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
153 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
154 |
/** Some random classes to load. */ |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
155 |
private static String[] classnames = { |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
156 |
"java.text.DecimalFormat", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
157 |
"java.text.MessageFormat", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
158 |
"java.util.GregorianCalendar", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
159 |
"java.util.ResourceBundle", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
160 |
"java.text.Collator", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
161 |
"java.util.Date", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
162 |
"java.io.Reader", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
163 |
"java.io.Writer", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
164 |
"java.lang.IllegalAccessException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
165 |
"java.lang.InstantiationException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
166 |
"java.lang.ClassNotFoundException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
167 |
"java.lang.CloneNotSupportedException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
168 |
"java.lang.InterruptedException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
169 |
"java.lang.NoSuchFieldException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
170 |
"java.lang.NoSuchMethodException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
171 |
"java.lang.RuntimeException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
172 |
"java.lang.ArithmeticException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
173 |
"java.lang.ArrayStoreException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
174 |
"java.lang.ClassCastException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
175 |
"java.lang.StringIndexOutOfBoundsException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
176 |
"java.lang.NegativeArraySizeException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
177 |
"java.lang.IllegalStateException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
178 |
"java.lang.IllegalArgumentException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
179 |
"java.lang.NumberFormatException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
180 |
"java.lang.IllegalThreadStateException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
181 |
"java.lang.IllegalMonitorStateException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
182 |
"java.lang.SecurityException", |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
183 |
"java.lang.ExceptionInInitializerError" |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
184 |
}; |
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
185 |
|
364944ba4e2f
8195981: Move some tests to OpenJDK for jdk_lang test group
amlu
parents:
diff
changeset
|
186 |
} |