Mercurial > hg > truffle
annotate test/compiler/6895383/Test.java @ 1305:97fe2cc98b1d
Merge
author | twisti |
---|---|
date | Thu, 18 Mar 2010 06:36:43 -0700 |
parents | acebf2655d3a |
children | c18cbe5936b8 |
rev | line source |
---|---|
1100
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
1 /* |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
4 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
8 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
13 * accompanied this code). |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
14 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
18 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
20 * CA 95054 USA or visit www.sun.com if you need additional information or |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
21 * have any questions. |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
22 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
23 */ |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
24 |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
25 /** |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
26 * @test |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
27 * @bug 6895383 |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
28 * @summary JCK test throws NPE for method compiled with Escape Analysis |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
29 * |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
30 * @run main/othervm -Xcomp Test |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
31 */ |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
32 |
1177
acebf2655d3a
6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents:
1100
diff
changeset
|
33 import java.util.*; |
acebf2655d3a
6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents:
1100
diff
changeset
|
34 import java.util.concurrent.*; |
acebf2655d3a
6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents:
1100
diff
changeset
|
35 |
1100
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
36 public class Test { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
37 public static void main(String argv[]) { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
38 Test test = new Test(); |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
39 test.testRemove1_IndexOutOfBounds(); |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
40 test.testAddAll1_IndexOutOfBoundsException(); |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
41 } |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
42 |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
43 public void testRemove1_IndexOutOfBounds() { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
44 CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
45 } |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
46 |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
47 public void testAddAll1_IndexOutOfBoundsException() { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
48 try { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
49 CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
50 c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
51 } catch (IndexOutOfBoundsException e) { |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
52 } |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
53 } |
f96a1a986f7b
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
54 } |