author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 41705 | hotspot/test/compiler/escapeAnalysis/Test6895383.java@332239c052cc |
permissions | -rw-r--r-- |
4470
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
1 |
/* |
7662
5f31baaff55b
7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass
trims
parents:
5547
diff
changeset
|
2 |
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
4470
1e6edcab3109
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. |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
4 |
* |
1e6edcab3109
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 |
1e6edcab3109
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 |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
8 |
* |
1e6edcab3109
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 |
1e6edcab3109
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 |
1e6edcab3109
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 |
1e6edcab3109
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 |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
13 |
* accompanied this code). |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
14 |
* |
1e6edcab3109
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 |
1e6edcab3109
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, |
1e6edcab3109
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. |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
18 |
* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4648
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4648
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4648
diff
changeset
|
21 |
* questions. |
4470
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
22 |
*/ |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
23 |
|
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
24 |
/** |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
25 |
* @test |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
26 |
* @bug 6895383 |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
27 |
* @summary JCK test throws NPE for method compiled with Escape Analysis |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
28 |
* |
40059 | 29 |
* @run main/othervm -Xcomp compiler.escapeAnalysis.Test6895383 |
4470
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
30 |
*/ |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
31 |
|
40059 | 32 |
package compiler.escapeAnalysis; |
4648
22e8816b84d3
6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents:
4470
diff
changeset
|
33 |
|
40059 | 34 |
import java.util.LinkedList; |
35 |
import java.util.concurrent.CopyOnWriteArrayList; |
|
36 |
||
37 |
public class Test6895383 { |
|
4470
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
38 |
public static void main(String argv[]) { |
40059 | 39 |
Test6895383 test = new Test6895383(); |
4470
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
40 |
test.testRemove1_IndexOutOfBounds(); |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
41 |
test.testAddAll1_IndexOutOfBoundsException(); |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
42 |
} |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
43 |
|
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
44 |
public void testRemove1_IndexOutOfBounds() { |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
45 |
CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
46 |
} |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
47 |
|
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
48 |
public void testAddAll1_IndexOutOfBoundsException() { |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
49 |
try { |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
50 |
CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
51 |
c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
52 |
} catch (IndexOutOfBoundsException e) { |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
53 |
} |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
54 |
} |
1e6edcab3109
6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff
changeset
|
55 |
} |