annotate test/compiler/6857159/Test6857159.java @ 855:f9094a5e1c8a

6857159: local schedule failed with checkcast of Thread.currentThread() Reviewed-by: kvn
author never
date Tue, 21 Jul 2009 16:42:58 -0700
parents
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
855
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
1 /*
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
4 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
7 * published by the Free Software Foundation.
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
8 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
13 * accompanied this code).
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
14 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
18 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
21 * have any questions.
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
22 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
23 */
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
24
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
25 /**
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
26 * @test
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
27 * @bug 6857159
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
28 * @summary local schedule failed with checkcast of Thread.currentThread()
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
29 *
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
30 * @run shell Test6857159.sh
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
31 */
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
32
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
33 public class Test6857159 extends Thread {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
34 static class ct0 extends Test6857159 {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
35 public void message() {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
36 // System.out.println("message");
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
37 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
38
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
39 public void run() {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
40 message();
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
41 ct0 ct = (ct0) Thread.currentThread();
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
42 ct.message();
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
43 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
44 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
45 static class ct1 extends ct0 {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
46 public void message() {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
47 // System.out.println("message");
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
48 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
49 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
50 static class ct2 extends ct0 {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
51 public void message() {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
52 // System.out.println("message");
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
53 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
54 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
55
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
56 public static void main(String[] args) throws Exception {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
57 for (int i = 0; i < 100000; i++) {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
58 Thread t = null;
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
59 switch (i % 3) {
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
60 case 0: t = new ct0(); break;
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
61 case 1: t = new ct1(); break;
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
62 case 2: t = new ct2(); break;
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
63 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
64 t.start();
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
65 t.join();
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
66 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
67 }
f9094a5e1c8a 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
68 }