mcimadamore@186: /* mcimadamore@186: * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@186: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@186: * mcimadamore@186: * This code is free software; you can redistribute it and/or modify it mcimadamore@186: * under the terms of the GNU General Public License version 2 only, as mcimadamore@186: * published by the Free Software Foundation. mcimadamore@186: * mcimadamore@186: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@186: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@186: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@186: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@186: * accompanied this code). mcimadamore@186: * mcimadamore@186: * You should have received a copy of the GNU General Public License version mcimadamore@186: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@186: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@186: * mcimadamore@186: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@186: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@186: * have any questions. mcimadamore@186: */ mcimadamore@186: mcimadamore@186: /* mcimadamore@186: * @test mcimadamore@186: * @bug 6723444 mcimadamore@186: * mcimadamore@186: * @summary javac fails to substitute type variables into a constructor's throws clause mcimadamore@186: * @author Mark Mahieu mcimadamore@186: * @compile/fail/ref=T6723444.out -XDstdout -XDrawDiagnostics T6723444.java mcimadamore@186: * mcimadamore@186: */ mcimadamore@186: public class T6723444 { mcimadamore@186: mcimadamore@186: static class Foo { mcimadamore@186: Foo() throws X {} mcimadamore@186: } mcimadamore@186: mcimadamore@186: T6723444() mcimadamore@186: throws X {} mcimadamore@186: mcimadamore@186: T6723444(Foo foo) mcimadamore@186: throws X {} mcimadamore@186: mcimadamore@186: T6723444(Foo foo, int i) mcimadamore@186: throws X1, X2 {} mcimadamore@186: mcimadamore@186: public static void main(String[] args) throws Exception { mcimadamore@186: mcimadamore@186: // the following 8 statements should compile without error mcimadamore@186: mcimadamore@186: Foo exFoo = new Foo(); mcimadamore@186: exFoo = new Foo() {}; mcimadamore@186: mcimadamore@186: new T6723444(); mcimadamore@186: new T6723444() {}; mcimadamore@186: new T6723444(exFoo); mcimadamore@186: new T6723444(exFoo) {}; mcimadamore@186: new T6723444(exFoo, 1); mcimadamore@186: new T6723444(exFoo, 1) {}; mcimadamore@186: mcimadamore@186: // the remaining statements should all raise an mcimadamore@186: // unreported exception error mcimadamore@186: mcimadamore@186: new T6723444(exFoo, 1); mcimadamore@186: new T6723444(exFoo, 1) {}; mcimadamore@186: mcimadamore@186: Foo thFoo = new Foo(); mcimadamore@186: thFoo = new Foo() {}; mcimadamore@186: mcimadamore@186: new T6723444(); mcimadamore@186: new T6723444() {}; mcimadamore@186: new T6723444(thFoo); mcimadamore@186: new T6723444(thFoo) {}; mcimadamore@186: new T6723444(thFoo, 1); mcimadamore@186: new T6723444(thFoo, 1) {}; mcimadamore@186: new T6723444(thFoo, 1); mcimadamore@186: new T6723444(thFoo, 1) {}; mcimadamore@186: } mcimadamore@186: }