hotspot/test/compiler/escapeAnalysis/Test6895383.java
author tpivovarova
Tue, 12 Jul 2016 18:24:48 +0300
changeset 40059 c2304140ed64
parent 27699 hotspot/test/compiler/escapeAnalysis/6895383/Test.java@9913b19c0948
child 41705 332239c052cc
permissions -rw-r--r--
8132919: Put compiler tests in packages Reviewed-by: vlivanov, dpochepk Contributed-by: igor.ignatyev@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
/**
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    26
 * @test
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    27
 * @bug 6895383
1e6edcab3109 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
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    29
 *
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    30
 * @run main/othervm -Xcomp compiler.escapeAnalysis.Test6895383
4470
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    31
 */
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    32
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    33
package compiler.escapeAnalysis;
4648
22e8816b84d3 6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents: 4470
diff changeset
    34
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    35
import java.util.LinkedList;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    36
import java.util.concurrent.CopyOnWriteArrayList;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    37
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    38
public class Test6895383 {
4470
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    39
    public static void main(String argv[]) {
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    40
        Test6895383 test = new Test6895383();
4470
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    41
        test.testRemove1_IndexOutOfBounds();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    42
        test.testAddAll1_IndexOutOfBoundsException();
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
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    45
    public void testRemove1_IndexOutOfBounds() {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    46
        CopyOnWriteArrayList c = new CopyOnWriteArrayList();
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
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    49
    public void testAddAll1_IndexOutOfBoundsException() {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    50
        try {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    51
            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    52
            c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    53
        } catch (IndexOutOfBoundsException e) {
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
    }
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    56
}