77 private boolean warnOnSyntheticConflicts; |
77 private boolean warnOnSyntheticConflicts; |
78 private boolean suppressAbortOnBadClassFile; |
78 private boolean suppressAbortOnBadClassFile; |
79 private boolean enableSunApiLintControl; |
79 private boolean enableSunApiLintControl; |
80 private final TreeInfo treeinfo; |
80 private final TreeInfo treeinfo; |
81 private final JavaFileManager fileManager; |
81 private final JavaFileManager fileManager; |
|
82 private final Profile profile; |
82 |
83 |
83 // The set of lint options currently in effect. It is initialized |
84 // The set of lint options currently in effect. It is initialized |
84 // from the context, and then is set/reset as needed by Attr as it |
85 // from the context, and then is set/reset as needed by Attr as it |
85 // visits all the various parts of the trees during attribution. |
86 // visits all the various parts of the trees during attribution. |
86 private Lint lint; |
87 private Lint lint; |
104 rs = Resolve.instance(context); |
105 rs = Resolve.instance(context); |
105 syms = Symtab.instance(context); |
106 syms = Symtab.instance(context); |
106 enter = Enter.instance(context); |
107 enter = Enter.instance(context); |
107 deferredAttr = DeferredAttr.instance(context); |
108 deferredAttr = DeferredAttr.instance(context); |
108 infer = Infer.instance(context); |
109 infer = Infer.instance(context); |
109 this.types = Types.instance(context); |
110 types = Types.instance(context); |
110 diags = JCDiagnostic.Factory.instance(context); |
111 diags = JCDiagnostic.Factory.instance(context); |
111 Options options = Options.instance(context); |
112 Options options = Options.instance(context); |
112 lint = Lint.instance(context); |
113 lint = Lint.instance(context); |
113 treeinfo = TreeInfo.instance(context); |
114 treeinfo = TreeInfo.instance(context); |
114 fileManager = context.get(JavaFileManager.class); |
115 fileManager = context.get(JavaFileManager.class); |
126 suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile"); |
127 suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile"); |
127 enableSunApiLintControl = options.isSet("enableSunApiLintControl"); |
128 enableSunApiLintControl = options.isSet("enableSunApiLintControl"); |
128 |
129 |
129 Target target = Target.instance(context); |
130 Target target = Target.instance(context); |
130 syntheticNameChar = target.syntheticNameChar(); |
131 syntheticNameChar = target.syntheticNameChar(); |
|
132 |
|
133 profile = Profile.instance(context); |
131 |
134 |
132 boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); |
135 boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); |
133 boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); |
136 boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); |
134 boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI); |
137 boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI); |
135 boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings(); |
138 boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings(); |
3004 } |
3007 } |
3005 }); |
3008 }); |
3006 } |
3009 } |
3007 } |
3010 } |
3008 |
3011 |
|
3012 void checkProfile(final DiagnosticPosition pos, final Symbol s) { |
|
3013 if (profile != Profile.DEFAULT && (s.flags() & NOT_IN_PROFILE) != 0) { |
|
3014 log.error(pos, "not.in.profile", s, profile); |
|
3015 } |
|
3016 } |
|
3017 |
3009 /* ************************************************************************* |
3018 /* ************************************************************************* |
3010 * Check for recursive annotation elements. |
3019 * Check for recursive annotation elements. |
3011 **************************************************************************/ |
3020 **************************************************************************/ |
3012 |
3021 |
3013 /** Check for cycles in the graph of annotation elements. |
3022 /** Check for cycles in the graph of annotation elements. |