mcimadamore@537: /* mcimadamore@537: * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@537: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@537: * mcimadamore@537: * This code is free software; you can redistribute it and/or modify it mcimadamore@537: * under the terms of the GNU General Public License version 2 only, as mcimadamore@537: * published by the Free Software Foundation. mcimadamore@537: * mcimadamore@537: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@537: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@537: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@537: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@537: * accompanied this code). mcimadamore@537: * mcimadamore@537: * You should have received a copy of the GNU General Public License version mcimadamore@537: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@537: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@537: * mcimadamore@537: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@537: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@537: * have any questions. mcimadamore@537: */ mcimadamore@537: mcimadamore@537: /* mcimadamore@537: * @test mcimadamore@537: * @bug 6939620 mcimadamore@537: * mcimadamore@537: * @summary Switch to 'complex' diamond inference scheme mcimadamore@537: * @author mcimadamore mcimadamore@537: * @compile Pos02.java mcimadamore@537: * @run main Pos02 mcimadamore@537: */ mcimadamore@537: mcimadamore@537: public class Pos02 { mcimadamore@537: mcimadamore@537: static class Foo { mcimadamore@537: Foo(X x) {} mcimadamore@537: Foo(X x, Z z) {} mcimadamore@537: } mcimadamore@537: mcimadamore@537: void testSimple() { mcimadamore@537: Foo f1 = new Foo<>(1); mcimadamore@537: Foo f2 = new Foo<>(1); mcimadamore@537: Foo f3 = new Foo<>(1); mcimadamore@537: Foo f4 = new Foo<>(1); mcimadamore@537: mcimadamore@537: Foo f5 = new Foo<>(1){}; mcimadamore@537: Foo f6 = new Foo<>(1){}; mcimadamore@537: Foo f7 = new Foo<>(1){}; mcimadamore@537: Foo f8 = new Foo<>(1){}; mcimadamore@537: mcimadamore@537: Foo f9 = new Foo<>(1, ""); mcimadamore@537: Foo f10 = new Foo<>(1, ""); mcimadamore@537: Foo f11 = new Foo<>(1, ""); mcimadamore@537: Foo f12 = new Foo<>(1, ""); mcimadamore@537: mcimadamore@537: Foo f13 = new Foo<>(1, ""){}; mcimadamore@537: Foo f14 = new Foo<>(1, ""){}; mcimadamore@537: Foo f15 = new Foo<>(1, ""){}; mcimadamore@537: Foo f16 = new Foo<>(1, ""){}; mcimadamore@537: } mcimadamore@537: mcimadamore@537: void testQualified() { mcimadamore@537: Foo f1 = new Pos02.Foo<>(1); mcimadamore@537: Foo f2 = new Pos02.Foo<>(1); mcimadamore@537: Foo f3 = new Pos02.Foo<>(1); mcimadamore@537: Foo f4 = new Pos02.Foo<>(1); mcimadamore@537: mcimadamore@537: Foo f5 = new Pos02.Foo<>(1){}; mcimadamore@537: Foo f6 = new Pos02.Foo<>(1){}; mcimadamore@537: Foo f7 = new Pos02.Foo<>(1){}; mcimadamore@537: Foo f8 = new Pos02.Foo<>(1){}; mcimadamore@537: mcimadamore@537: Foo f9 = new Pos02.Foo<>(1, ""); mcimadamore@537: Foo f10 = new Pos02.Foo<>(1, ""); mcimadamore@537: Foo f11 = new Pos02.Foo<>(1, ""); mcimadamore@537: Foo f12 = new Pos02.Foo<>(1, ""); mcimadamore@537: mcimadamore@537: Foo f13 = new Pos02.Foo<>(1, ""){}; mcimadamore@537: Foo f14 = new Pos02.Foo<>(1, ""){}; mcimadamore@537: Foo f15 = new Pos02.Foo<>(1, ""){}; mcimadamore@537: Foo f16 = new Pos02.Foo<>(1, ""){}; mcimadamore@537: } mcimadamore@537: mcimadamore@537: public static void main(String[] args) { mcimadamore@537: Pos02 p2 = new Pos02(); mcimadamore@537: p2.testSimple(); mcimadamore@537: p2.testQualified(); mcimadamore@537: } mcimadamore@537: }