--- old/src/share/classes/com/sun/tools/javac/comp/Check.java 2013-01-18 02:48:27.526841979 -0500 +++ new/src/share/classes/com/sun/tools/javac/comp/Check.java 2013-01-18 02:48:26.666793946 -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); @@ -128,6 +129,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); @@ -3005,6 +3008,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.