1421N/A/*
1421N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
1421N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1421N/A *
1421N/A * This code is free software; you can redistribute it and/or modify it
1421N/A * under the terms of the GNU General Public License version 2 only, as
1421N/A * published by the Free Software Foundation.
1421N/A *
1421N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1421N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1421N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1421N/A * version 2 for more details (a copy is included in the LICENSE file that
1421N/A * accompanied this code).
1421N/A *
1421N/A * You should have received a copy of the GNU General Public License version
1421N/A * 2 along with this work; if not, write to the Free Software Foundation,
1421N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1421N/A *
1421N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1421N/A * or visit www.oracle.com if you need additional information or have any
1421N/A * questions.
1421N/A */
1421N/A
1421N/A/*
1421N/A * @test
1421N/A * @bug 7160084
1421N/A * @summary javac fails to compile an apparently valid class/interface combination
1421N/A */
1421N/Apublic class T7160084b {
1421N/A
1421N/A static int assertionCount = 0;
1421N/A
1421N/A static void assertTrue(boolean cond) {
1421N/A assertionCount++;
1421N/A if (!cond) {
1421N/A throw new AssertionError();
1421N/A }
1421N/A }
1421N/A
1421N/A interface Extras {
1421N/A static class Enums {
1421N/A static class Component {
1421N/A Component() { throw new RuntimeException("oops!"); }
1421N/A }
1421N/A }
1421N/A }
1421N/A
1421N/A interface Test {
1421N/A public class Enums {
1421N/A interface Widget {
1421N/A enum Component { X, Y };
1421N/A }
1421N/A
1421N/A enum Component implements Widget, Extras {
1421N/A Z;
1421N/A };
1421N/A
1421N/A public static void test() {
1421N/A assertTrue(Component.values().length == 1);
1421N/A }
1421N/A }
1421N/A }
1421N/A
1421N/A public static void main(String[] args) {
1421N/A Test.Enums.test();
1421N/A assertTrue(assertionCount == 1);
1421N/A }
1421N/A}