Thu, 11 Apr 2013 09:39:57 -0700
Added tag jdk8-b85 for changeset 42fe530cd478
kvn@1535 | 1 | /* |
trims@2384 | 2 | * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
kvn@1535 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
kvn@1535 | 4 | * |
kvn@1535 | 5 | * This code is free software; you can redistribute it and/or modify it |
kvn@1535 | 6 | * under the terms of the GNU General Public License version 2 only, as |
kvn@1535 | 7 | * published by the Free Software Foundation. |
kvn@1535 | 8 | * |
kvn@1535 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
kvn@1535 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
kvn@1535 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
kvn@1535 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
kvn@1535 | 13 | * accompanied this code). |
kvn@1535 | 14 | * |
kvn@1535 | 15 | * You should have received a copy of the GNU General Public License version |
kvn@1535 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
kvn@1535 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
kvn@1535 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
kvn@1535 | 22 | * |
kvn@1535 | 23 | */ |
kvn@1535 | 24 | |
kvn@1535 | 25 | /** |
kvn@1535 | 26 | * @test |
kvn@1535 | 27 | * @bug 6895383 |
kvn@1535 | 28 | * @summary JCK test throws NPE for method compiled with Escape Analysis |
kvn@1535 | 29 | * |
kvn@1535 | 30 | * @run main/othervm -Xcomp Test |
kvn@1535 | 31 | */ |
kvn@1535 | 32 | |
kvn@1612 | 33 | import java.util.*; |
kvn@1612 | 34 | import java.util.concurrent.*; |
kvn@1612 | 35 | |
kvn@1535 | 36 | public class Test { |
kvn@1535 | 37 | public static void main(String argv[]) { |
kvn@1535 | 38 | Test test = new Test(); |
kvn@1535 | 39 | test.testRemove1_IndexOutOfBounds(); |
kvn@1535 | 40 | test.testAddAll1_IndexOutOfBoundsException(); |
kvn@1535 | 41 | } |
kvn@1535 | 42 | |
kvn@1535 | 43 | public void testRemove1_IndexOutOfBounds() { |
kvn@1535 | 44 | CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
kvn@1535 | 45 | } |
kvn@1535 | 46 | |
kvn@1535 | 47 | public void testAddAll1_IndexOutOfBoundsException() { |
kvn@1535 | 48 | try { |
kvn@1535 | 49 | CopyOnWriteArrayList c = new CopyOnWriteArrayList(); |
kvn@1535 | 50 | c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException |
kvn@1535 | 51 | } catch (IndexOutOfBoundsException e) { |
kvn@1535 | 52 | } |
kvn@1535 | 53 | } |
kvn@1535 | 54 | } |