changeset 7:38bd6375f37d

6663588: Compiler goes into infinite loop for Cyclic Inheritance test case Summary: interplay between cyclic inheritance and tvar bounds hangs javac Reviewed-by: jjg
author mcimadamore
date Tue, 04 Mar 2008 15:45:20 +0000
parents d472e2fbcc39
children f09d6a3521b1
files src/share/classes/com/sun/tools/javac/comp/MemberEnter.java test/tools/javac/T6663588.java
diffstat 2 files changed, 36 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Tue Mar 04 15:19:06 2008 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Tue Mar 04 15:45:20 2008 +0000
@@ -901,10 +901,10 @@
                 c.flags_field |= DEPRECATED;
             annotateLater(tree.mods.annotations, baseEnv, c);
 
+            chk.checkNonCyclic(tree.pos(), c.type);
+
             attr.attribTypeVariables(tree.typarams, baseEnv);
 
-            chk.checkNonCyclic(tree.pos(), c.type);
-
             // Add default constructor if needed.
             if ((c.flags() & INTERFACE) == 0 &&
                 !TreeInfo.hasConstructors(tree.defs)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6663588.java	Tue Mar 04 15:45:20 2008 +0000
@@ -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<T extends T6663588.Inner> extends T6663588 {
+     class Inner extends T6663588.Inner {}
+}