kvn@1535: /* trims@2384: * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. kvn@1535: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. kvn@1535: * kvn@1535: * This code is free software; you can redistribute it and/or modify it kvn@1535: * under the terms of the GNU General Public License version 2 only, as kvn@1535: * published by the Free Software Foundation. kvn@1535: * kvn@1535: * This code is distributed in the hope that it will be useful, but WITHOUT kvn@1535: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or kvn@1535: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License kvn@1535: * version 2 for more details (a copy is included in the LICENSE file that kvn@1535: * accompanied this code). kvn@1535: * kvn@1535: * You should have received a copy of the GNU General Public License version kvn@1535: * 2 along with this work; if not, write to the Free Software Foundation, kvn@1535: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. kvn@1535: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. kvn@1535: * kvn@1535: */ kvn@1535: kvn@1535: /** kvn@1535: * @test kvn@1535: * @bug 6895383 kvn@1535: * @summary JCK test throws NPE for method compiled with Escape Analysis kvn@1535: * kvn@1535: * @run main/othervm -Xcomp Test kvn@1535: */ kvn@1535: kvn@1612: import java.util.*; kvn@1612: import java.util.concurrent.*; kvn@1612: kvn@1535: public class Test { kvn@1535: public static void main(String argv[]) { kvn@1535: Test test = new Test(); kvn@1535: test.testRemove1_IndexOutOfBounds(); kvn@1535: test.testAddAll1_IndexOutOfBoundsException(); kvn@1535: } kvn@1535: kvn@1535: public void testRemove1_IndexOutOfBounds() { kvn@1535: CopyOnWriteArrayList c = new CopyOnWriteArrayList(); kvn@1535: } kvn@1535: kvn@1535: public void testAddAll1_IndexOutOfBoundsException() { kvn@1535: try { kvn@1535: CopyOnWriteArrayList c = new CopyOnWriteArrayList(); kvn@1535: c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException kvn@1535: } catch (IndexOutOfBoundsException e) { kvn@1535: } kvn@1535: } kvn@1535: }