From e82f62558354b1366e6ad061d88d5ce1fb240007 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Tue, 4 Mar 2008 15:45:20 +0000 Subject: [PATCH] 6663588: Compiler goes into infinite loop for Cyclic Inheritance test case Interplay between cyclic inheritance and tvar bounds hangs javac Reviewed-by: jjg --- .../com/sun/tools/javac/comp/MemberEnter.java | 4 +-- langtools/test/tools/javac/T6663588.java | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 langtools/test/tools/javac/T6663588.java diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java index 5a2f188b5bc..5c698ac16a7 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java @@ -901,10 +901,10 @@ public class MemberEnter extends JCTree.Visitor implements Completer { c.flags_field |= DEPRECATED; annotateLater(tree.mods.annotations, baseEnv, c); - attr.attribTypeVariables(tree.typarams, baseEnv); - chk.checkNonCyclic(tree.pos(), c.type); + attr.attribTypeVariables(tree.typarams, baseEnv); + // Add default constructor if needed. if ((c.flags() & INTERFACE) == 0 && !TreeInfo.hasConstructors(tree.defs)) { diff --git a/langtools/test/tools/javac/T6663588.java b/langtools/test/tools/javac/T6663588.java new file mode 100644 index 00000000000..9c1dfa9202e --- /dev/null +++ b/langtools/test/tools/javac/T6663588.java @@ -0,0 +1,34 @@ +/* + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6663588 + * @summary Compiler goes into infinite loop for Cyclic Inheritance test case + * @author Maurizio Cimadamore + * @compile/fail T6663588.java + */ + +public class T6663588 extends T6663588 { + class Inner extends T6663588.Inner {} +}