hotspot/test/compiler/6895383/Test.java
author kvn
Tue, 19 Jan 2010 10:25:54 -0800
changeset 4648 22e8816b84d3
parent 4470 1e6edcab3109
child 5547 f4b087cbb361
permissions -rw-r--r--
6917931: compiler/6895383/Test.java don't compile due missed imports Summary: Add missing imports. Reviewed-by: never, twisti
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
/*
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
     2
 * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
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
 *
1e6edcab3109 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,
1e6edcab3109 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
1e6edcab3109 6895383: JCK test throws NPE for method compiled with Escape Analysis
kvn
parents:
diff changeset
    21
 * have any questions.
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
}