hotspot/test/compiler/6895383/Test.java
author pchelko
Mon, 16 Jun 2014 17:13:58 +0400
changeset 25197 533f45be322f
parent 7662 5f31baaff55b
permissions -rw-r--r--
8046221: [TEST_BUG] Cleanup datatransfer tests Reviewed-by: anthony, alexsch
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
 *
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    30
 * @run main/othervm -Xcomp Test
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
4648
22e8816b84d3 6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents: 4470
diff changeset
    33
import java.util.*;
22e8816b84d3 6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents: 4470
diff changeset
    34
import java.util.concurrent.*;
22e8816b84d3 6917931: compiler/6895383/Test.java don't compile due missed imports
kvn
parents: 4470
diff changeset
    35
4470
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    36
public class Test {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    37
    public static void main(String argv[]) {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    38
        Test test = new Test();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    39
        test.testRemove1_IndexOutOfBounds();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    40
        test.testAddAll1_IndexOutOfBoundsException();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    41
    }
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
    public void testRemove1_IndexOutOfBounds() {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    44
        CopyOnWriteArrayList c = new CopyOnWriteArrayList();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    45
    }
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
    public void testAddAll1_IndexOutOfBoundsException() {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    48
        try {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    49
            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    50
            c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    51
        } catch (IndexOutOfBoundsException e) {
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    52
        }
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
}