src/share/classes/com/sun/tools/javac/comp/Check.java

changeset 1603
6118072811e5
parent 1588
2620c953e9fe
parent 1571
af8417e590f4
child 1607
bd49e0304281
equal deleted inserted replaced
1602:dabb36173c63 1603:6118072811e5
78 private boolean warnOnSyntheticConflicts; 78 private boolean warnOnSyntheticConflicts;
79 private boolean suppressAbortOnBadClassFile; 79 private boolean suppressAbortOnBadClassFile;
80 private boolean enableSunApiLintControl; 80 private boolean enableSunApiLintControl;
81 private final TreeInfo treeinfo; 81 private final TreeInfo treeinfo;
82 private final JavaFileManager fileManager; 82 private final JavaFileManager fileManager;
83 private final Profile profile;
83 84
84 // The set of lint options currently in effect. It is initialized 85 // The set of lint options currently in effect. It is initialized
85 // from the context, and then is set/reset as needed by Attr as it 86 // from the context, and then is set/reset as needed by Attr as it
86 // visits all the various parts of the trees during attribution. 87 // visits all the various parts of the trees during attribution.
87 private Lint lint; 88 private Lint lint;
108 rs = Resolve.instance(context); 109 rs = Resolve.instance(context);
109 syms = Symtab.instance(context); 110 syms = Symtab.instance(context);
110 enter = Enter.instance(context); 111 enter = Enter.instance(context);
111 deferredAttr = DeferredAttr.instance(context); 112 deferredAttr = DeferredAttr.instance(context);
112 infer = Infer.instance(context); 113 infer = Infer.instance(context);
113 this.types = Types.instance(context); 114 types = Types.instance(context);
114 diags = JCDiagnostic.Factory.instance(context); 115 diags = JCDiagnostic.Factory.instance(context);
115 Options options = Options.instance(context); 116 Options options = Options.instance(context);
116 lint = Lint.instance(context); 117 lint = Lint.instance(context);
117 treeinfo = TreeInfo.instance(context); 118 treeinfo = TreeInfo.instance(context);
118 fileManager = context.get(JavaFileManager.class); 119 fileManager = context.get(JavaFileManager.class);
130 suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile"); 131 suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
131 enableSunApiLintControl = options.isSet("enableSunApiLintControl"); 132 enableSunApiLintControl = options.isSet("enableSunApiLintControl");
132 133
133 Target target = Target.instance(context); 134 Target target = Target.instance(context);
134 syntheticNameChar = target.syntheticNameChar(); 135 syntheticNameChar = target.syntheticNameChar();
136
137 profile = Profile.instance(context);
135 138
136 boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); 139 boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
137 boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); 140 boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
138 boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI); 141 boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
139 boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings(); 142 boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();
3066 } 3069 }
3067 }); 3070 });
3068 } 3071 }
3069 } 3072 }
3070 3073
3074 void checkProfile(final DiagnosticPosition pos, final Symbol s) {
3075 if (profile != Profile.DEFAULT && (s.flags() & NOT_IN_PROFILE) != 0) {
3076 log.error(pos, "not.in.profile", s, profile);
3077 }
3078 }
3079
3071 /* ************************************************************************* 3080 /* *************************************************************************
3072 * Check for recursive annotation elements. 3081 * Check for recursive annotation elements.
3073 **************************************************************************/ 3082 **************************************************************************/
3074 3083
3075 /** Check for cycles in the graph of annotation elements. 3084 /** Check for cycles in the graph of annotation elements.

mercurial