1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Sep 23 17:27:38 2013 +0400 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Sep 23 18:29:27 2013 +0400 1.3 @@ -3102,8 +3102,14 @@ 1.4 public void visitTypeTest(JCInstanceOf tree) { 1.5 Type exprtype = chk.checkNullOrRefType( 1.6 tree.expr.pos(), attribExpr(tree.expr, env)); 1.7 - Type clazztype = chk.checkReifiableReferenceType( 1.8 - tree.clazz.pos(), attribType(tree.clazz, env)); 1.9 + Type clazztype = attribType(tree.clazz, env); 1.10 + if (!clazztype.hasTag(TYPEVAR)) { 1.11 + clazztype = chk.checkClassOrArrayType(tree.clazz.pos(), clazztype); 1.12 + } 1.13 + if (!clazztype.isErroneous() && !types.isReifiable(clazztype)) { 1.14 + log.error(tree.clazz.pos(), "illegal.generic.type.for.instof"); 1.15 + clazztype = types.createErrorType(clazztype); 1.16 + } 1.17 chk.validate(tree.clazz, env, false); 1.18 chk.checkCastable(tree.expr.pos(), exprtype, clazztype); 1.19 result = check(tree, syms.booleanType, VAL, resultInfo);