src/share/classes/com/sun/tools/javac/jvm/ClassReader.java

changeset 1603
6118072811e5
parent 1592
9345394ac8fe
parent 1571
af8417e590f4
child 1755
ddb4a2bfcd82
equal deleted inserted replaced
1602:dabb36173c63 1603:6118072811e5
132 * Switch: prefer source files instead of newer when both source 132 * Switch: prefer source files instead of newer when both source
133 * and class are available 133 * and class are available
134 **/ 134 **/
135 public boolean preferSource; 135 public boolean preferSource;
136 136
137 /**
138 * The currently selected profile.
139 */
140 public final Profile profile;
141
137 /** The log to use for verbose output 142 /** The log to use for verbose output
138 */ 143 */
139 final Log log; 144 final Log log;
140 145
141 /** The symbol table. */ 146 /** The symbol table. */
282 287
283 Options options = Options.instance(context); 288 Options options = Options.instance(context);
284 annotate = Annotate.instance(context); 289 annotate = Annotate.instance(context);
285 verbose = options.isSet(VERBOSE); 290 verbose = options.isSet(VERBOSE);
286 checkClassFile = options.isSet("-checkclassfile"); 291 checkClassFile = options.isSet("-checkclassfile");
292
287 Source source = Source.instance(context); 293 Source source = Source.instance(context);
288 allowGenerics = source.allowGenerics(); 294 allowGenerics = source.allowGenerics();
289 allowVarargs = source.allowVarargs(); 295 allowVarargs = source.allowVarargs();
290 allowAnnotations = source.allowAnnotations(); 296 allowAnnotations = source.allowAnnotations();
291 allowSimplifiedVarargs = source.allowSimplifiedVarargs(); 297 allowSimplifiedVarargs = source.allowSimplifiedVarargs();
292 allowDefaultMethods = source.allowDefaultMethods(); 298 allowDefaultMethods = source.allowDefaultMethods();
299
293 saveParameterNames = options.isSet("save-parameter-names"); 300 saveParameterNames = options.isSet("save-parameter-names");
294 cacheCompletionFailure = options.isUnset("dev"); 301 cacheCompletionFailure = options.isUnset("dev");
295 preferSource = "source".equals(options.get("-Xprefer")); 302 preferSource = "source".equals(options.get("-Xprefer"));
303
304 profile = Profile.instance(context);
296 305
297 completionFailureName = 306 completionFailureName =
298 options.isSet("failcomplete") 307 options.isSet("failcomplete")
299 ? names.fromString(options.get("failcomplete")) 308 ? names.fromString(options.get("failcomplete"))
300 : null; 309 : null;
1370 new ListBuffer<CompoundAnnotationProxy>(); 1379 new ListBuffer<CompoundAnnotationProxy>();
1371 for (int i = 0; i<numAttributes; i++) { 1380 for (int i = 0; i<numAttributes; i++) {
1372 CompoundAnnotationProxy proxy = readCompoundAnnotation(); 1381 CompoundAnnotationProxy proxy = readCompoundAnnotation();
1373 if (proxy.type.tsym == syms.proprietaryType.tsym) 1382 if (proxy.type.tsym == syms.proprietaryType.tsym)
1374 sym.flags_field |= PROPRIETARY; 1383 sym.flags_field |= PROPRIETARY;
1375 else 1384 else if (proxy.type.tsym == syms.profileType.tsym) {
1385 if (profile != Profile.DEFAULT) {
1386 for (Pair<Name,Attribute> v: proxy.values) {
1387 if (v.fst == names.value && v.snd instanceof Attribute.Constant) {
1388 Attribute.Constant c = (Attribute.Constant) v.snd;
1389 if (c.type == syms.intType && ((Integer) c.value) > profile.value) {
1390 sym.flags_field |= NOT_IN_PROFILE;
1391 }
1392 }
1393 }
1394 }
1395 } else
1376 proxies.append(proxy); 1396 proxies.append(proxy);
1377 } 1397 }
1378 annotate.normal(new AnnotationCompleter(sym, proxies.toList())); 1398 annotate.normal(new AnnotationCompleter(sym, proxies.toList()));
1379 } 1399 }
1380 } 1400 }

mercurial