diff -r 5f0731e4e5e6 -r 475eb15dfdad src/share/classes/com/sun/tools/javac/comp/Check.java --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Jan 21 00:45:35 2013 -0500 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Jan 21 01:27:42 2013 -0500 @@ -79,6 +79,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 @@ -106,7 +107,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); @@ -129,6 +130,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); @@ -3006,6 +3009,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. **************************************************************************/