mcimadamore@356: /* mcimadamore@356: * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@356: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@356: * mcimadamore@356: * This code is free software; you can redistribute it and/or modify it mcimadamore@356: * under the terms of the GNU General Public License version 2 only, as mcimadamore@356: * published by the Free Software Foundation. mcimadamore@356: * mcimadamore@356: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@356: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@356: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@356: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@356: * accompanied this code). mcimadamore@356: * mcimadamore@356: * You should have received a copy of the GNU General Public License version mcimadamore@356: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@356: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@356: * mcimadamore@356: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@356: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@356: * have any questions. mcimadamore@356: */ mcimadamore@356: mcimadamore@356: /* mcimadamore@356: * @test mcimadamore@356: * @bug 6806876 mcimadamore@356: * @author mcimadamore mcimadamore@356: * @summary ClassCastException occurs in assignment expressions without any heap pollutions mcimadamore@356: * @compile/fail/ref=T6806876.out -Xlint:unchecked -Werror -XDrawDiagnostics T6806876.java mcimadamore@356: */ mcimadamore@356: mcimadamore@356: class T6806876 { mcimadamore@356: void test(Integer i, Long l) { mcimadamore@356: Comparable[] res = m(i, l); mcimadamore@356: } mcimadamore@356: mcimadamore@356: T[] m(T...a) { mcimadamore@356: return null; mcimadamore@356: } mcimadamore@356: }