mcimadamore@81: /* ohair@554: * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. mcimadamore@81: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@81: * mcimadamore@81: * This code is free software; you can redistribute it and/or modify it mcimadamore@81: * under the terms of the GNU General Public License version 2 only, as mcimadamore@81: * published by the Free Software Foundation. mcimadamore@81: * mcimadamore@81: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@81: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@81: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@81: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@81: * accompanied this code). mcimadamore@81: * mcimadamore@81: * You should have received a copy of the GNU General Public License version mcimadamore@81: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@81: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@81: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. mcimadamore@81: */ mcimadamore@81: mcimadamore@81: /* mcimadamore@81: * @test mcimadamore@81: * @bug 6500701 mcimadamore@81: * @summary Enhanced for loop with generics generates faulty bytecode mcimadamore@81: * @author Maurizio Cimadamore mcimadamore@81: * mcimadamore@81: */ mcimadamore@81: mcimadamore@81: import java.util.ArrayList; mcimadamore@81: import java.util.List; mcimadamore@81: mcimadamore@81: public class T6500701 { mcimadamore@81: mcimadamore@81: private static void test() { mcimadamore@81: List list = new ArrayList(); mcimadamore@81: list.add(""); mcimadamore@81: List aList = new ArrayList(); mcimadamore@81: aList.addAll(list); mcimadamore@81: for (Object a : aList) { mcimadamore@81: System.out.println(a); mcimadamore@81: } mcimadamore@81: } mcimadamore@81: mcimadamore@81: public static void main(String[] args) { mcimadamore@81: test(); mcimadamore@81: } mcimadamore@81: }