1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Sep 23 23:30:31 2011 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Oct 06 18:39:31 2011 +0100 1.3 @@ -1169,12 +1169,17 @@ 1.4 if (lint.isEnabled(LintCategory.RAW) && 1.5 tree.type.tag == CLASS && 1.6 !TreeInfo.isDiamond(tree) && 1.7 - !env.enclClass.name.isEmpty() && //anonymous or intersection 1.8 + !withinAnonConstr(env) && 1.9 tree.type.isRaw()) { 1.10 log.warning(LintCategory.RAW, 1.11 tree.pos(), "raw.class.use", tree.type, tree.type.tsym.type); 1.12 } 1.13 } 1.14 + 1.15 + boolean withinAnonConstr(Env<AttrContext> env) { 1.16 + return env.enclClass.name.isEmpty() && 1.17 + env.enclMethod != null && env.enclMethod.name == names.init; 1.18 + } 1.19 } 1.20 1.21 /* *************************************************************************