提交 d9ddfd1f 编写于 作者: M mcimadamore

6835430: javac does not generate signature attributes for classes extending...

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
上级 140ef0f5
......@@ -1521,9 +1521,9 @@ public class ClassWriter extends ClassFile {
int acount = 0;
boolean sigReq =
typarams.length() != 0 || supertype.getTypeArguments().length() != 0;
typarams.length() != 0 || supertype.allparams().length() != 0;
for (List<Type> 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);
......
/*
* 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<T extends A<T>> {
class C {
public T getT() { return null; }
}
}
class B extends A<B> {
public class D extends A<B>.C {}
}
/*
* 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();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册