src/share/classes/com/sun/tools/javac/main/JavaCompiler.java

changeset 1961
58da1296c6b3
parent 1825
e701af23a095
child 1982
662a5188bded
equal deleted inserted replaced
1960:e811fb09a1dc 1961:58da1296c6b3
361 log.error("cant.access", ex.sym, ex.getDetailValue()); 361 log.error("cant.access", ex.sym, ex.getDetailValue());
362 if (ex instanceof ClassReader.BadClassFile) 362 if (ex instanceof ClassReader.BadClassFile)
363 throw new Abort(); 363 throw new Abort();
364 } 364 }
365 source = Source.instance(context); 365 source = Source.instance(context);
366 Target target = Target.instance(context);
366 attr = Attr.instance(context); 367 attr = Attr.instance(context);
367 chk = Check.instance(context); 368 chk = Check.instance(context);
368 gen = Gen.instance(context); 369 gen = Gen.instance(context);
369 flow = Flow.instance(context); 370 flow = Flow.instance(context);
370 transTypes = TransTypes.instance(context); 371 transTypes = TransTypes.instance(context);
401 log.warning(LintCategory.OPTIONS, "source.no.bootclasspath", source.name); 402 log.warning(LintCategory.OPTIONS, "source.no.bootclasspath", source.name);
402 } 403 }
403 } 404 }
404 } 405 }
405 406
407 checkForObsoleteOptions(target);
408
406 verboseCompilePolicy = options.isSet("verboseCompilePolicy"); 409 verboseCompilePolicy = options.isSet("verboseCompilePolicy");
407 410
408 if (attrParseOnly) 411 if (attrParseOnly)
409 compilePolicy = CompilePolicy.ATTR_ONLY; 412 compilePolicy = CompilePolicy.ATTR_ONLY;
410 else 413 else
428 ? CompileState.valueOf(options.get("shouldStopPolicyIfNoError")) 431 ? CompileState.valueOf(options.get("shouldStopPolicyIfNoError"))
429 : CompileState.GENERATE; 432 : CompileState.GENERATE;
430 433
431 if (options.isUnset("oldDiags")) 434 if (options.isUnset("oldDiags"))
432 log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context)); 435 log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));
436 }
437
438 private void checkForObsoleteOptions(Target target) {
439 // Unless lint checking on options is disabled, check for
440 // obsolete source and target options.
441 boolean obsoleteOptionFound = false;
442 if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) {
443 if (source.compareTo(Source.JDK1_5) <= 0) {
444 log.warning(LintCategory.OPTIONS, "option.obsolete.source", source.name);
445 obsoleteOptionFound = true;
446 }
447
448 if (target.compareTo(Target.JDK1_5) <= 0) {
449 log.warning(LintCategory.OPTIONS, "option.obsolete.target", source.name);
450 obsoleteOptionFound = true;
451 }
452
453 if (obsoleteOptionFound)
454 log.warning(LintCategory.OPTIONS, "option.obsolete.suppression");
455 }
433 } 456 }
434 457
435 /* Switches: 458 /* Switches:
436 */ 459 */
437 460

mercurial