test/tools/javac/generics/diamond/6996914/T6996914b.java

Mon, 07 Mar 2011 14:31:50 +0000

author
mcimadamore
date
Mon, 07 Mar 2011 14:31:50 +0000
changeset 914
ca32f2986301
parent 740
bce19889597e
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
Summary: Disallow diamond on anonymous innner class creation expression (as per JSR 334's EDR)
Reviewed-by: jjg

mcimadamore@740 1 /*
mcimadamore@914 2 * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
mcimadamore@740 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@740 4 *
mcimadamore@740 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@740 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@740 7 * published by the Free Software Foundation.
mcimadamore@740 8 *
mcimadamore@740 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@740 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@740 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@740 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@740 13 * accompanied this code).
mcimadamore@740 14 *
mcimadamore@740 15 * You should have received a copy of the GNU General Public License version
mcimadamore@740 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@740 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@740 18 *
mcimadamore@740 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@740 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@740 21 * questions.
mcimadamore@740 22 */
mcimadamore@740 23
mcimadamore@740 24 /*
mcimadamore@740 25 * @test
mcimadamore@914 26 * @bug 6996914 7020044
mcimadamore@740 27 * @summary Diamond inference: problem when accessing protected constructor
mcimadamore@740 28 * @compile T6996914b.java
mcimadamore@740 29 */
mcimadamore@740 30
mcimadamore@740 31 class Super<X,Y> {
mcimadamore@740 32 private Super(Integer i, Y y, X x) {}
mcimadamore@740 33 public Super(Number n, X x, Y y) {}
mcimadamore@740 34 }
mcimadamore@740 35
mcimadamore@740 36 class Test {
mcimadamore@740 37 Super<String,Integer> ssi1 = new Super<>(1, "", 2);
mcimadamore@740 38 }

mercurial