diff -r dabb36173c63 -r 6118072811e5 src/share/classes/com/sun/tools/javac/comp/Check.java --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Feb 21 12:23:27 2013 -0800 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Feb 21 17:49:56 2013 -0800 @@ -80,6 +80,7 @@ private boolean enableSunApiLintControl; private final TreeInfo treeinfo; private final JavaFileManager fileManager; + private final Profile profile; // The set of lint options currently in effect. It is initialized // from the context, and then is set/reset as needed by Attr as it @@ -110,7 +111,7 @@ enter = Enter.instance(context); deferredAttr = DeferredAttr.instance(context); infer = Infer.instance(context); - this.types = Types.instance(context); + types = Types.instance(context); diags = JCDiagnostic.Factory.instance(context); Options options = Options.instance(context); lint = Lint.instance(context); @@ -133,6 +134,8 @@ Target target = Target.instance(context); syntheticNameChar = target.syntheticNameChar(); + profile = Profile.instance(context); + boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI); @@ -3068,6 +3071,12 @@ } } + void checkProfile(final DiagnosticPosition pos, final Symbol s) { + if (profile != Profile.DEFAULT && (s.flags() & NOT_IN_PROFILE) != 0) { + log.error(pos, "not.in.profile", s, profile); + } + } + /* ************************************************************************* * Check for recursive annotation elements. **************************************************************************/