# HG changeset patch # User mcimadamore # Date 1245145542 -3600 # Node ID c9fe0e7472acb31bafa919df676ea8fe21a531b6 # Parent a8590199a00e0b77e72d465c33c9077feb614d2e 6835430: javac does not generate signature attributes for classes extending parameterized inner classes Summary: ClassWriter does not consider outer params of an inner class when emitting signature attributes Reviewed-by: jjg diff -r a8590199a00e -r c9fe0e7472ac langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Tue Jun 16 10:45:11 2009 +0100 +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Tue Jun 16 10:45:42 2009 +0100 @@ -1521,9 +1521,9 @@ int acount = 0; boolean sigReq = - typarams.length() != 0 || supertype.getTypeArguments().length() != 0; + typarams.length() != 0 || supertype.allparams().length() != 0; for (List l = interfaces; !sigReq && l.nonEmpty(); l = l.tail) - sigReq = l.head.getTypeArguments().length() != 0; + sigReq = l.head.allparams().length() != 0; if (sigReq) { assert source.allowGenerics(); int alenIdx = writeAttr(names.Signature); diff -r a8590199a00e -r c9fe0e7472ac langtools/test/tools/javac/6835430/A.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/6835430/A.java Tue Jun 16 10:45:42 2009 +0100 @@ -0,0 +1,32 @@ +/* + * Copyright 2009 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. + */ + +class A> { + class C { + public T getT() { return null; } + } +} + +class B extends A { + public class D extends A.C {} +} diff -r a8590199a00e -r c9fe0e7472ac langtools/test/tools/javac/6835430/T6835430.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/6835430/T6835430.java Tue Jun 16 10:45:42 2009 +0100 @@ -0,0 +1,38 @@ +/* + * Copyright 2009 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 6835430 + * @summary 6835430: javac does not generate signature attributes for classes extending parameterized inner classes + * @author mcimadamore + * + * @compile A.java + * @compile T6835430.java + */ + +class T6835430 { + void test(B.D d) { + B b = d.getT(); + } +}