Mercurial > hg > openjdk > jdk8 > langtools
changeset 1901:fae8f309ff80
8016640: compiler hangs if the generics arity of a base class is wrong
Summary: Check.checkCompatibleConcretes hang when javac creates synthetic supertypes for 269 model API
Reviewed-by: jjg
author | mcimadamore |
---|---|
date | Wed, 17 Jul 2013 14:16:25 +0100 |
parents | db2c539819dd |
children | 155809b1b969 |
files | src/share/classes/com/sun/tools/javac/code/Types.java src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java test/tools/javac/generics/8016640/T8016640.java test/tools/javac/generics/8016640/T8016640.out |
diffstat | 4 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Types.java Wed Jul 17 14:14:49 2013 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java Wed Jul 17 14:16:25 2013 +0100 @@ -2245,7 +2245,7 @@ @Override public Type visitErrorType(ErrorType t, Void ignored) { - return t; + return Type.noType; } }; // </editor-fold>
--- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Wed Jul 17 14:14:49 2013 +0100 +++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Wed Jul 17 14:16:25 2013 +0100 @@ -46,6 +46,7 @@ import com.sun.tools.javac.code.Symbol.*; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.Type.ClassType; +import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.comp.AttrContext; import com.sun.tools.javac.comp.Env; import com.sun.tools.javac.tree.JCTree; @@ -516,7 +517,7 @@ return null; Type sup = env.types.supertype(type); return TypeMaker.getType(env, - (sup != type) ? sup : env.syms.objectType); + (sup.hasTag(TypeTag.NONE)) ? env.syms.objectType : sup); } /**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/8016640/T8016640.java Wed Jul 17 14:16:25 2013 +0100 @@ -0,0 +1,10 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8016640 + * @summary compiler hangs if the generics arity of a base class is wrong + * @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java + */ +class T8016640 { + static class Foo<X,Y> { } + static class BadFoo<T> extends Foo<T> { } +}